From 479a50b9e291ea5cd59e7df6a12fc537b4220254 Mon Sep 17 00:00:00 2001 From: jao Date: Wed, 18 Dec 2019 15:11:31 +0000 Subject: linting and doom background --- src/lib/Monitors.hs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/lib/Monitors.hs') 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" , " \ \ยท " @@ -101,7 +101,7 @@ batt p = ["-t", " " , "-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", " \9211 " , "-o", " ๐Ÿ”‹ " , "-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", "ยฐ" @@ -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", ""] + ["--total-icon-pattern", "", "-c"] diskIO p = DiskIO [("nvme0n1p2" @@ -177,7 +177,7 @@ masterVol = Volume "default" "Master" ["-t", " " , "--", "-C", "black", "-c", "sienna4" - , "-O", "๐ŸŽง" + , "-O", "๐ŸŽง" -- ๐ŸŽง , "-o", "๐Ÿ”‡"] 10 captureVol = Volume "default" "Capture" ["-t", ""] 10 -- cgit v1.2.3