diff options
-rw-r--r-- | src/TopC.hs | 7 | ||||
-rw-r--r-- | src/lib/Bottom.hs | 2 | ||||
-rw-r--r-- | src/lib/Config.hs | 36 | ||||
-rw-r--r-- | src/lib/Monitors.hs | 57 |
4 files changed, 66 insertions, 36 deletions
diff --git a/src/TopC.hs b/src/TopC.hs index 54c3bb8..0509e5c 100644 --- a/src/TopC.hs +++ b/src/TopC.hs @@ -5,7 +5,8 @@ import Music (mpris) topProcL p = TopProc (p <~> ["-t" , "<both1> <mboth1>" , "-w", "10", "-L" , "10", "-H", "80"]) 15 -diskIOL p = DiskIO [("nvme0n1p2", "<total>")] (diskArgs p) 10 +diskIOL p = DiskIO [("/", "<totalbvbar>"), ("/home", "<totalbvbar>")] + (diskArgs p) 10 mpd = MPD [ "-W", "12", "-b", "░", "-f", "▒", "-t", " <remaining>"] 10 @@ -57,8 +58,8 @@ config p = (baseConfig p) { \ <action=`toggle-app.sh nm-applet`>|tun0||wlp1s0wi|</action> \ \ |dynnetwork| \ \ <action=`toggle-app.sh pasystray`>|default:Master|\ - \ |default:Capture|</action> |EGPH|\ - \ |mail| <fn=1>|kbd|</fn>{}\ + \ |default:Capture|</action>\ + \|mail|<fn=1>|kbd|</fn>{}\ \ <action=`toggle-pipe.sh /tmp/mpris.st`>|" ++ (alias m) ++ "|</action>\ \ |multicpu| |top| |memory|\ diff --git a/src/lib/Bottom.hs b/src/lib/Bottom.hs index a6a79c4..6ab5b40 100644 --- a/src/lib/Bottom.hs +++ b/src/lib/Bottom.hs @@ -26,7 +26,7 @@ config cs tpl p = (baseConfig p) { , Run tun0 , Run (weather "EGPH" p) -- LEGE, LEBL, KCV0 , Run trayPadding - , Run mail + , Run (mail p) , Run masterVol , Run captureVol , Run laTime diff --git a/src/lib/Config.hs b/src/lib/Config.hs index 59d9f3d..119a4e5 100644 --- a/src/lib/Config.hs +++ b/src/lib/Config.hs @@ -1,4 +1,5 @@ -module Config (Palette(..), baseConfig, palette, (<~>), mkArgs, defaultHeight) +module Config ( + Palette(..), baseConfig, palette, (<~>), (>~<), mkArgs, defaultHeight) where import System.Environment (lookupEnv) @@ -23,6 +24,8 @@ data Palette = Palette { pNormal :: String lightTheme :: IO Bool lightTheme = fmap (== (Just "light")) (lookupEnv "JAO_COLOR_SCHEME") +icons k = "/home/jao/.config/xmobar/icons/" ++ k + lightPalette :: Palette lightPalette = Palette { pNormal = "black" , pLow = "#4d4d4d" @@ -32,21 +35,28 @@ lightPalette = Palette { pNormal = "black" , pForeground = "#000000" , pBackground = "white" , pAlpha = 255 - , pIconRoot = "/home/jao/.xmobar/icons/light" + , pIconRoot = icons "light" , pIsLight = True } +zenburnRed = "#CC9393" +zenburnBack = "#2B2B2B" +zenburnBackLight = "#383838" +zenburnFg = "#DCDCCC" +zenburnYl = "#F0DFAF" +zenburnGreen = "#7F9F7F" + darkPalette :: Palette -darkPalette = Palette { pNormal = "gray77" - , pLow = "gray60" - , pHigh = "#a0522d" +darkPalette = Palette { pNormal = zenburnFg + , pLow = zenburnGreen + , pHigh = zenburnRed , pFont = "xft:Source Code Pro Medium-9" -- , pFont = "xft:NotoMono-9,xft:Inconsolata-11" - , pBorder = "grey30" - , pForeground = "grey77" -- "grey60" - , pBackground = "#2B2B2B" -- "black" + , pBorder = zenburnBackLight + , pForeground = zenburnFg + , pBackground = zenburnBack , pAlpha = 255 - , pIconRoot = "/home/jao/.xmobar/icons/dark" + , pIconRoot = icons "dark" , pIsLight = False } @@ -86,5 +96,13 @@ baseConfig p = defaultConfig { ] ] +(>~<) :: Palette -> [String] -> [String] +(>~<) p args = concat [ args + , [ "--low", (pHigh p) + , "--normal", (pNormal p) + , "--high", (pLow p) + ] + ] + mkArgs :: Palette -> [String] -> [String] -> [String] mkArgs p args extra = concat [(p <~> args), ["--"], extra] diff --git a/src/lib/Monitors.hs b/src/lib/Monitors.hs index c0a890c..daa59b7 100644 --- a/src/lib/Monitors.hs +++ b/src/lib/Monitors.hs @@ -48,7 +48,7 @@ topProc' p = TopProc (p <~> ["-t" , "<mboth1> <mboth2> <mboth3> \ \· <both1> <both2> <both3>" , "-w", "10", "-L" , "10", "-H", "80"]) 15 -wireless p n = Wireless n (p <~> ["-t" , "<essid> <quality>" +wireless p n = Wireless n (p >~< ["-t" , "<essid> <quality>" , "-W", "5", "-M", "15" , "-m", "3" , "-L", "20", "-H", "80"]) 20 @@ -91,24 +91,25 @@ weather st p = , ("partly cloudy", "<fn=3>⛅</fn>") , ("mostly cloudy", "<fn=3>☁</fn>") , ("considerable cloudiness", "<fn=4>⛈</fn>")] - (p <~> ["-t", "<skyConditionS> <tempC>° <rh>% <windKmh>" + (p <~> ["-t", "<skyConditionS> <tempC>° <rh>% <windKmh> (<hour>)" , "-L","10", "-H", "25"]) 18000 batt p = BatteryN ["BAT0"] - ["-t", "<acstatus> <left>%" + ["-t", "<acstatus> <left>" , "-S", "Off", "-d", "0", "-m", "3" , "-L", "10", "-H", "90", "-p", "3" , "--low", (pHigh p), "--normal", (pNormal p), "--high", (pLow p) , "--" + , "-P" , "-a", "notify-send -u critical 'Battery running out!!!!!!'" , "-A", "7" , "-i", "<fn=2>\9211</fn>" , "-O", " <fn=2>\9211</fn> <timeleft> <watts>" , "-o", " <fn=2>🔋</fn> <timeleft> <watts>" - , "-H", "16", "-L", "10" - , "-h", "sienna4", "-l", "gray20"] 50 "batt0" + , "-H", "10", "-L", "7" + , "-h", (pHigh p), "-l", (pLow p)] 50 "batt0" avgCoretemp p = MultiCoreTemp (p <~> ["-t", "<avg>°" @@ -119,7 +120,7 @@ coreTemp p = , "-L", "50", "-H", "75", "-d", "0"]) 50 diskU p = - DiskU [("nvme0n1p2", "<used>") , ("/media/sdb", " s <used>")] + DiskU [("/home", "<used>") , ("/media/sdb", " s <used>")] (p <~> ["-L", "20", "-H", "70", "-m", "1", "-p", "3"]) 20 @@ -135,23 +136,33 @@ diskIO p = ] (diskArgs p) 10 -- <fn=1>📨 🖅 🖃 📩 ✉ </fn> -mbox = MBox [ ("L", "/var/mail/jao", "grey60") - -- , ("B", "bigml.spool", "sienna4") - -- , ("S", "bigsup.spool", "sienna4") - -- , ("G", "geiser.spool", "darkseagreen4") - -- , ("X", "xmobar.spool", "darkseagreen4") - -- , ("g", "gnu.spool", "") - -- , ("k", "books.spool", "") - ] [] -- ["-p", "<fn=2>📩 </fn>", "-s", ""] - "mbox" - -mail = Mail [ ("I", "~/var/maildir/jao/inbox") - , ("G", "~/var/maildir/jao/geiser") - , ("X", "~/var/maildir/jao/xmobar") - , ("B", "~/var/maildir/bigml/inbox") - , ("S", "~/var/maildir/bigml/support") - ] - "mail" +-- mbox = MBox [ ("L", "/var/mail/jao", "grey60") +-- -- , ("B", "bigml.spool", "sienna4") +-- -- , ("S", "bigsup.spool", "sienna4") +-- -- , ("G", "geiser.spool", "darkseagreen4") +-- -- , ("X", "xmobar.spool", "darkseagreen4") +-- -- , ("g", "gnu.spool", "") +-- -- , ("k", "books.spool", "") +-- ] [] -- ["-p", "<fn=2>📩 </fn>", "-s", ""] +-- "mbox" + +-- mail = Mail [ ("I", "~/var/maildir/jao/inbox") +-- , ("G", "~/var/maildir/jao/geiser") +-- , ("X", "~/var/maildir/jao/xmobar") +-- , ("B", "~/var/maildir/bigml/inbox") +-- , ("S", "~/var/maildir/bigml/support") +-- ] +-- "mail" + +mail p = MailX [ ("I", "jao/inbox", pHigh p) + , ("G", "jao/geiser", "") + , ("X", "jao/xmobar", "") + , ("g", "jao/gnu", pLow p) + , ("B", "bigml/inbox", pHigh p) + , ("S", "bigml/support", "") + ] + ["-d", "~/var/maildir", "-p", " ", "-s", " "] + "mail" -- mail = Mail [ ("<fc=darkseagreen4><fn=2>🖃 </fn></fc>", "~/var/maildir/jao/inbox") -- , ("<fc=darkseagreen3><fn=2>🖃 </fn></fc>", "~/var/maildir/jao/geiser") |