summaryrefslogtreecommitdiffhomepage
path: root/src/lib/Monitors.hs
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2019-12-18 15:11:31 +0000
committerjao <jao@gnu.org>2019-12-18 15:11:31 +0000
commit479a50b9e291ea5cd59e7df6a12fc537b4220254 (patch)
tree1b3ffcf7b7edc7e7c8b51adf934e971aff93a67a /src/lib/Monitors.hs
parent318ce5d54950aea41bb2f3bfce73658a03bc691a (diff)
downloadxmobar-config-479a50b9e291ea5cd59e7df6a12fc537b4220254.tar.gz
xmobar-config-479a50b9e291ea5cd59e7df6a12fc537b4220254.tar.bz2
linting and doom background
Diffstat (limited to 'src/lib/Monitors.hs')
-rw-r--r--src/lib/Monitors.hs22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/lib/Monitors.hs b/src/lib/Monitors.hs
index d589ce1..7d57f5d 100644
--- a/src/lib/Monitors.hs
+++ b/src/lib/Monitors.hs
@@ -15,7 +15,7 @@ instance (Read a, Read b) => Read (CombinedMonitor a b) where
readsPrec _ = undefined
instance (Exec a, Exec b) => Exec (CombinedMonitor a b) where
- alias (CombinedMonitor a b _) = (alias a) ++ "_" ++ (alias b)
+ alias (CombinedMonitor a b _) = alias a ++ "_" ++ alias b
rate (CombinedMonitor a b _) = min (rate a) (rate b)
start (CombinedMonitor a b comb) cb
= startMonitors a b (\s t -> cb $ comb s t)
@@ -23,22 +23,22 @@ instance (Exec a, Exec b) => Exec (CombinedMonitor a b) where
startMonitors a b cmb = do
sta <- atomically $ newTVar ""
stb <- atomically $ newTVar ""
- _ <- async $ start a (\x -> atomically $ writeTVar sta x)
- _ <- async $ start b (\x -> atomically $ writeTVar stb x)
+ _ <- async $ start a (atomically . writeTVar sta)
+ _ <- async $ start b (atomically . writeTVar stb)
go sta stb
where go sta' stb' = do
- s <- atomically $ readTVar sta'
- t <- atomically $ readTVar stb'
+ s <- readTVarIO sta'
+ t <- readTVarIO stb'
cmb s t
tenthSeconds $ min (rate b) (rate a)
go sta' stb'
guardedMonitor a p = CombinedMonitor (PipeReader p (alias a ++ "_g")) a f
- where f s t = if (null s || head s == '0') then "" else t
+ where f s t = if null s || head s == '0' then "" else t
altMonitor a b = CombinedMonitor a b (\s t -> if null s then t else s)
concatMonitor sep a b = CombinedMonitor a b (\s t -> s ++ sep ++ t)
-toggleMonitor path a b = altMonitor (guardedMonitor a path) b
+toggleMonitor path a = altMonitor (guardedMonitor a path)
topProc p = TopProc (p <~> ["-t" , "<mboth3> <mboth2> <mboth1> \
\ยท <both3> <both2> <both1>"
@@ -101,7 +101,7 @@ batt p =
["-t", "<acstatus> <left>"
, "-S", "Off", "-d", "0", "-m", "3"
, "-L", "10", "-H", "90", "-p", "3"
- , "--low", (pHigh p), "--normal", (pNormal p), "--high", (pLow p)
+ , "--low", pHigh p, "--normal", pNormal p, "--high", pLow p
, "--"
, "-P"
, "-a", "notify-send -u critical 'Battery running out!!!!!!'"
@@ -110,7 +110,7 @@ batt p =
, "-O", " <fn=2>\9211</fn> <timeleft> <watts>"
, "-o", " <fn=2>๐Ÿ”‹</fn> <timeleft> <watts>"
, "-H", "10", "-L", "7"
- , "-h", (pHigh p), "-l", (pLow p)] 50 "batt0"
+ , "-h", pHigh p, "-l", pLow p] 50 "batt0"
avgCoretemp p =
MultiCoreTemp (p <~> ["-t", "<avg>ยฐ"
@@ -128,7 +128,7 @@ diskU p =
diskArgs p = mkArgs p
["-f", "โ–‘", "-b", " ", "-L", "10000000", "-H" , "100000000"
, "-W", "5", "-w", "5", "-p", "3"]
- ["--total-icon-pattern", "<icon=load_%%.xpm/>"]
+ ["--total-icon-pattern", "<icon=load_%%.xpm/>", "-c"]
diskIO p =
DiskIO [("nvme0n1p2"
@@ -177,7 +177,7 @@ masterVol =
Volume "default" "Master"
["-t", "<status> <volume>"
, "--", "-C", "black", "-c", "sienna4"
- , "-O", "<fn=4>๐ŸŽง</fn>"
+ , "-O", "<fn=4>๐ŸŽง</fn>" -- ๐ŸŽง
, "-o", "<fn=4>๐Ÿ”‡</fn>"] 10
captureVol = Volume "default" "Capture" ["-t", "<volume>"] 10