summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar/Plugins/Monitors/Swap.hs
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-03-30 22:23:10 +0100
committerjao <jao@gnu.org>2022-03-30 22:23:10 +0100
commit7af1ddc5ebbe9d651ffbc057614be18637e69939 (patch)
tree1b754ad28c697ced892215c43378b39afa58bc2b /src/Xmobar/Plugins/Monitors/Swap.hs
parent211af7d4cb5b29e71bcfbedae8f8c86009e99ad0 (diff)
downloadxmobar-7af1ddc5ebbe9d651ffbc057614be18637e69939.tar.gz
xmobar-7af1ddc5ebbe9d651ffbc057614be18637e69939.tar.bz2
Fix: consistent use of configured nastring instead of hardcoded N/A
Diffstat (limited to 'src/Xmobar/Plugins/Monitors/Swap.hs')
-rw-r--r--src/Xmobar/Plugins/Monitors/Swap.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Xmobar/Plugins/Monitors/Swap.hs b/src/Xmobar/Plugins/Monitors/Swap.hs
index e8b2f54..f10afad 100644
--- a/src/Xmobar/Plugins/Monitors/Swap.hs
+++ b/src/Xmobar/Plugins/Monitors/Swap.hs
@@ -24,9 +24,8 @@ import qualified Xmobar.Plugins.Monitors.Swap.Linux as MS
#endif
swapConfig :: IO MConfig
-swapConfig = mkMConfig
- "Swap: <usedratio>%" -- template
- ["usedratio", "total", "used", "free"] -- available replacements
+swapConfig = mkMConfig "Swap: <usedratio>%"
+ ["usedratio", "total", "used", "free"]
formatSwap :: [Float] -> Monitor [String]
formatSwap (r:xs) = do
@@ -34,7 +33,7 @@ formatSwap (r:xs) = do
other <- mapM (showWithColors (showDigits d)) xs
ratio <- showPercentWithColors r
return $ ratio:other
-formatSwap _ = return $ replicate 4 "N/A"
+formatSwap _ = replicate 4 `fmap` getConfigValue naString
runSwap :: [String] -> Monitor String
runSwap _ =