From f83dbd551de2d55122d8f338f024c2a23da2a51c Mon Sep 17 00:00:00 2001 From: jao Date: Mon, 15 Mar 2021 04:18:35 +0000 Subject: clean ups --- src/lib/Monitors.hs | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'src/lib/Monitors.hs') diff --git a/src/lib/Monitors.hs b/src/lib/Monitors.hs index c96666c..8f8f81c 100644 --- a/src/lib/Monitors.hs +++ b/src/lib/Monitors.hs @@ -5,6 +5,8 @@ import Config import Control.Concurrent import Control.Concurrent.Async (async) import Control.Concurrent.STM +import qualified Data.Char as Char +import qualified Text.Printf as Printf data CombinedMonitor a b = CombinedMonitor a b (String -> String -> String) @@ -102,6 +104,17 @@ weather' tmp st p = weather = weather' " ° % ()" +-- "https://wttr.in?format=" ++ fnn 3 "%c" ++ "+%t+%C+%w++" ++ fnn 1 "%m" +-- , Run (ComX "curl" [wttrURL "Edinburgh"] "" "wttr" 18000) +wttrURL l = "https://wttr.in/" ++ l ++ "?format=" ++ fmt + where fmt = fnn 2 "+%c+" ++ "+%t+%C+" ++ fn 5 "%w" + fnn n x = urlEncode ("") ++ x ++ urlEncode "" + encode c + | c == ' ' = "+" + | Char.isAlphaNum c || c `elem` "-._~" = [c] + | otherwise = Printf.printf "%%%02X" c + urlEncode = concatMap encode + batt p = BatteryN ["BAT0"] ["-t", " " @@ -168,15 +181,19 @@ diskIO p = -- 📨 🖅 🖃 📩 ✉ -- (fni "\xf01c \xf03a \xf1fa \xf0e0 \xf1d8 ") mail p = MailX [ ("I", "jao/inbox", pHigh p) + , ("h", "jao/hacking", "") + , ("d", "jao/drivel", "") + , ("e", "jao/emacs", pDim p) + , ("g", "jao/gnu", pDim p) + , ("l", "jao/lists", pDim p) + , ("L", "jao/lobsters", pDim p) + , ("b", "jao/bills", pDim p) , ("B", "bigml/inbox", pHigh p) - , ("b", "bigml/bugs", pHigh p) , ("S", "bigml/support", "") - , ("L", "bigml/lists", pDim p) - , ("G", "jao/geiser", "") - , ("X", "jao/xmobar", "") + , ("L", "bigml/lists", "") ] [ "-d", "~/var/mail" - , "-p", fc (pHigh p) $ fn 1 "⎘ " -- fc (pLow p) (fni "\xf01c" ++ " ") + -- , "-p", fc (pHigh p) $ fn 1 "⎘ " -- fc (pLow p) (fni "\xf01c" ++ " ") , "-s", " " ] "mail" @@ -194,7 +211,7 @@ masterVol p = captureVol = Volume "default" "Capture" ["-t", ""] 10 -kbd p = Kbd [("us", kbi pDim), ("(unnamed)", kbi pDim), ("us(intl)", kbi pHigh)] +kbd p = Kbd [("us", ""), ("us(intl)", kbi pHigh)] -- kbi pDim where kbi a = fc (a p) (fni " \xf11c") brightness = Brightness ["--", "-D", "intel_backlight"] 10 -- cgit v1.2.3