xmobar 0.43 → 0.44
raw patch · 9 files changed
+26/−51 lines, 9 files
Files
- changelog.md +12/−1
- doc/plugins.org +5/−5
- src/Xmobar/Config/Parse.hs +2/−2
- src/Xmobar/Plugins/EWMH.hs +0/−10
- src/Xmobar/Plugins/Monitors/Common/Output.hs +4/−3
- src/Xmobar/Plugins/XMonadLog.hs +0/−11
- src/Xmobar/System/Localize.hsc +0/−6
- src/Xmobar/Text/SwaybarClicks.hs +0/−3
- xmobar.cabal +3/−10
changelog.md view
@@ -1,4 +1,15 @@-## Version 0.43 (May, 2023)+## Version 0.44 (July, 2022)++_Breaking changes_++ - Building with UTF-8 support is now mandatory (the with_utf8 flag+ is gone).++_Bug fixes_++ - Fix for -W "0" monitor spec in logarithmic bars.++## Version 0.43 (May, 2022) _New features_
doc/plugins.org view
@@ -1117,7 +1117,7 @@ - Aliases to the interface name: so =Network "eth0" []= can be used as =%eth0%=- - Thresholds refer to velocities expressed in Kb/s+ - Thresholds refer to velocities expressed in B/s - Args: default monitor arguments, plus: - =--rx-icon-pattern=: dynamic string for reception rate in =rxipat=.@@ -1129,15 +1129,15 @@ - Variables that can be used with the =-t=/=--template= argument: =dev=, =rx=, =tx=, =rxbar=, =rxvbar=, =rxipat=, =txbar=, =txvbar=, =txipat=, =up=. Reception and transmission rates (=rx= and =tx=) are displayed- by default as Kb/s, without any suffixes, but you can set the =-S= to- "True" to make them displayed with adaptive units (Kb/s, Mb/s, etc.).+ by default as KB/s, without any suffixes, but you can set the =-S= to+ "True" to make them displayed with adaptive units (KB/s, MB/s, etc.). - Default template: =<dev>: <rx>KB|<tx>KB= ***** =DynNetwork Args RefreshRate= - Active interface is detected automatically - Aliases to "dynnetwork"- - Thresholds are expressed in Kb/s+ - Thresholds are expressed in B/s - Args: default monitor arguments, plus: - =--rx-icon-pattern=: dynamic string for reception rate in =rxipat=.@@ -1150,7 +1150,7 @@ Reception and transmission rates (=rx= and =tx=) are displayed in Kbytes per second, and you can set the =-S= to "True" to make them displayed- with units (the string "Kb/s").+ with units (the string "KB/s"). - Default template: =<dev>: <rx>KB|<tx>KB= - Example of usage of =--devices= option:
src/Xmobar/Config/Parse.hs view
@@ -26,12 +26,12 @@ import Xmobar.Config.Types -#if defined XFT || defined UTF8+#ifdef XFT import qualified System.IO as S (readFile) #endif readFileSafe :: FilePath -> IO String-#if defined XFT || defined UTF8+#ifdef XFT readFileSafe = S.readFile #else readFileSafe = readFile
src/Xmobar/Plugins/EWMH.hs view
@@ -23,11 +23,7 @@ import Graphics.X11 hiding (Modifier, Color) import Graphics.X11.Xlib.Extras import Xmobar.Run.Exec-#ifdef UTF8-#undef UTF8 import Codec.Binary.UTF8.String as UTF8-#define UTF8-#endif import Foreign.C (CChar, CLong) import Xmobar.X11.Events (nextEvent') @@ -256,10 +252,4 @@ _ -> return () decodeCChar :: [CChar] -> String-#ifdef UTF8-#undef UTF8 decodeCChar = UTF8.decode . map fromIntegral-#define UTF8-#else-decodeCChar = map (toEnum . fromIntegral)-#endif
src/Xmobar/Plugins/Monitors/Common/Output.hs view
@@ -3,7 +3,7 @@ ------------------------------------------------------------------------------ -- | -- Module: Xmobar.Plugins.Monitors.Strings--- Copyright: (c) 2018, 2019, 2020 Jose Antonio Ortega Ruiz+-- Copyright: (c) 2018, 2019, 2020, 2022 Jose Antonio Ortega Ruiz -- License: BSD3-style (see LICENSE) -- -- Maintainer: jao@gnu.org@@ -261,9 +261,10 @@ l <- fromIntegral `fmap` getConfigValue low bw <- fromIntegral `fmap` getConfigValue barWidth let [ll, hh] = sort [l, h]+ bw' = if bw > 0 then bw else 10 scaled x | x == 0.0 = 0- | x <= ll = 1 / bw- | otherwise = f + logBase 2 (x / hh) / bw+ | x <= ll = 1 / bw'+ | otherwise = f + logBase 2 (x / hh) / bw' return $ scaled v showLogBar :: Float -> Float -> Monitor String
src/Xmobar/Plugins/XMonadLog.hs view
@@ -23,12 +23,7 @@ import Xmobar.Run.Exec import Xmobar.Run.Actions (stripActions) -#ifdef UTF8-#undef UTF8 import Codec.Binary.UTF8.String as UTF8-#define UTF8-#endif- import Foreign.C (CChar) import Data.List (intercalate) import Xmobar.X11.Events (nextEvent')@@ -86,10 +81,4 @@ return () decodeCChar :: [CChar] -> String-#ifdef UTF8-#undef UTF8 decodeCChar = UTF8.decode . map fromIntegral-#define UTF8-#else-decodeCChar = map (toEnum . fromIntegral)-#endif
src/Xmobar/System/Localize.hsc view
@@ -25,9 +25,7 @@ import qualified Data.Time.Format as L #endif -#ifdef UTF8 import Codec.Binary.UTF8.String-#endif -- get localized strings type NlItem = CInt@@ -48,12 +46,8 @@ getLangInfo :: NlItem -> IO String getLangInfo item = do itemStr <- nl_langinfo item-#ifdef UTF8 str <- peekCString itemStr return $ if isUTF8Encoded str then decodeString str else str-#else- peekCString itemStr-#endif #include <locale.h> foreign import ccall unsafe "locale.h setlocale"
src/Xmobar/Text/SwaybarClicks.hs view
@@ -23,9 +23,6 @@ import Data.Aeson---- import qualified Data.ByteString.Lazy as BL- import GHC.Generics import Xmobar.System.Utils (forkThread)
xmobar.cabal view
@@ -1,5 +1,5 @@ name: xmobar-version: 0.43+version: 0.44 homepage: https://github.com/jaor/xmobar synopsis: A Minimalistic Text Based Status Bar description: Xmobar is a minimalistic text based status bar.@@ -32,10 +32,6 @@ description: Use Xft to render text. UTF-8 support included. default: False -flag with_utf8- description: With UTF-8 support.- default: True- flag with_inotify description: inotify support (modern Linux only). Required for the Mail and MBox plugins. default: False@@ -206,7 +202,8 @@ stm >= 2.3 && < 2.6, time, transformers,- unix+ unix,+ utf8-string >= 0.3 && < 1.1 if impl(ghc < 8.0.2) -- Disable building with GHC before 8.0.2.@@ -228,10 +225,6 @@ build-depends: utf8-string >= 0.3 && < 1.1, X11-xft >= 0.2 && < 0.4 other-modules: Xmobar.X11.MinXft cpp-options: -DXFT-- if flag(with_utf8) || flag(all_extensions)- build-depends: utf8-string >= 0.3 && < 1.1- cpp-options: -DUTF8 if flag(with_inotify) || flag(all_extensions) build-depends: hinotify >= 0.3 && < 0.5