summaryrefslogtreecommitdiffhomepage
path: root/src/lib/Monitors.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/Monitors.hs')
-rw-r--r--src/lib/Monitors.hs29
1 files changed, 23 insertions, 6 deletions
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' "<skyConditionS> <tempC>° <rh>% <windKmh> (<hour>)"
+-- "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 ("<fn=" ++ show n ++ ">") ++ x ++ urlEncode "</fn>"
+ encode c
+ | c == ' ' = "+"
+ | Char.isAlphaNum c || c `elem` "-._~" = [c]
+ | otherwise = Printf.printf "%%%02X" c
+ urlEncode = concatMap encode
+
batt p =
BatteryN ["BAT0"]
["-t", "<acstatus> <left>"
@@ -168,15 +181,19 @@ diskIO p =
-- <fn=1>📨 🖅 🖃 📩 ✉ </fn>
-- (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", "<volume>"] 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