diff options
author | jao <jao@gnu.org> | 2020-02-01 04:33:16 +0000 |
---|---|---|
committer | jao <jao@gnu.org> | 2020-02-01 04:33:16 +0000 |
commit | f64764b95e9e713157bdb96a377c636479bfc40c (patch) | |
tree | b451429ba81391f66961bb54e7ead1c54f430bcc | |
parent | b9f23c8d2189352b409a461c065d635ecab3e893 (diff) | |
download | xmobar-config-f64764b95e9e713157bdb96a377c636479bfc40c.tar.gz xmobar-config-f64764b95e9e713157bdb96a377c636479bfc40c.tar.bz2 |
fn, fc
-rw-r--r-- | src/TopC.hs | 6 | ||||
-rw-r--r-- | src/lib/Bottom.hs | 2 | ||||
-rw-r--r-- | src/lib/Config.hs | 6 | ||||
-rw-r--r-- | src/lib/Monitors.hs | 48 | ||||
-rw-r--r-- | src/lib/Music.hs | 23 |
5 files changed, 38 insertions, 47 deletions
diff --git a/src/TopC.hs b/src/TopC.hs index f2fa458..a7ecf9d 100644 --- a/src/TopC.hs +++ b/src/TopC.hs @@ -56,14 +56,14 @@ config p = (baseConfig p) { ++ "<action=`toggle-app.sh pasystray`>|default:Master| \ \|default:Capture|</action> " ++ "<action=`toggle-pipe.sh /tmp/mpris.st`>|" ++ ma ++ "|</action>" - ++ " <fn=1>|kbd|</fn>" + ++ fn 1 " |kbd|" ++ " {} " ++ " |multicpu| " ++ " |top| " ++ "|memory| " - ++ "<fc=grey60>|diskio|</fc> |disku| " + ++ fc "grey60" "|diskio|" ++ " |disku| " ++ " |EGPH| " - ++ "<fn=2>๐ </fn>|datetime| |laTime| " + ++ fn 2 "๐ " ++ "|datetime| |laTime| " } where m = music (pIsLight p) ma = alias m w = (weather' "<skyConditionS> <tempC>ยฐ <weather>" "EGPH" p) diff --git a/src/lib/Bottom.hs b/src/lib/Bottom.hs index 6ab5b40..7f58efe 100644 --- a/src/lib/Bottom.hs +++ b/src/lib/Bottom.hs @@ -9,7 +9,7 @@ config cs tpl p = (baseConfig p) { position = BottomSize C 100 defaultHeight , textOffset = defaultHeight - 6 , textOffsets = [defaultHeight - 6, defaultHeight - 6, - defaultHeight - 4, defaultHeight - 6, + defaultHeight - 4, defaultHeight - 8, defaultHeight - 7] , border = TopB , template = "|tray| \ diff --git a/src/lib/Config.hs b/src/lib/Config.hs index 905773e..c2a7720 100644 --- a/src/lib/Config.hs +++ b/src/lib/Config.hs @@ -1,5 +1,6 @@ module Config ( - Palette(..), baseConfig, palette, (<~>), (>~<), mkArgs, defaultHeight) + Palette(..), baseConfig, palette, (<~>), (>~<), + mkArgs, defaultHeight, fc, fn) where import System.Environment (lookupEnv) @@ -21,6 +22,9 @@ data Palette = Palette { pNormal :: String , pIsLight :: Bool } +fc color thing = "<fc=" ++ color ++ ">" ++ thing ++ "</fc>" +fn n thing = "<fn=" ++ show n ++ ">" ++ thing ++ "</fn>" + lightTheme :: IO Bool lightTheme = fmap (== Just "light") (lookupEnv "JAO_COLOR_SCHEME") diff --git a/src/lib/Monitors.hs b/src/lib/Monitors.hs index 324043d..1a8d0d6 100644 --- a/src/lib/Monitors.hs +++ b/src/lib/Monitors.hs @@ -68,7 +68,7 @@ cpuFreq p = CpuFreq (p <~> ["-t" , "<cpu0> <cpu1> <cpu2> <cpu3>" , "-L", "1", "-H", "2", "-S", "Off" , "-d", "2"]) 50 -- โคโคโ โผ โง โฉ โ โ -dynNetwork p = DynNetwork (p <~> ["-t", "<fn=1>โ</fn> <tx> <fn=1>โ</fn> <rx>" +dynNetwork p = DynNetwork (p <~> ["-t", fn 1 "โ " ++ "<tx> " ++ fn 1 "โ" ++ " <rx>" , "-L", "20", "-H", "1024000" , "-m", "5", "-W", "10", "-S", "Off"]) 10 @@ -78,19 +78,19 @@ uptime p = Uptime (p <~> [ "-t" , "<days> <hours>", "-m", "3", "-c", "0", "-S" -- ๐ง weather' tmp st p = WeatherX st - [ ("", "<fc=gray60><fn=4>๐</fn></fc>") - , ("clear", "<fn=4>๐ฃ</fn>") - , ("sunny", "<fn=4>๐ฃ</fn>") - , ("mostly clear", "<fn=4>๐ค</fn>") - , ("mostly sunny", "<fn=4>๐ค</fn>") - , ("partly sunny", "<fn=3>โ
</fn>") - , ("fair", "<fn=4>๐</fn>") - , ("obscured", "<fn=4>๐</fn>") -- ๐ซ - , ("cloudy","<fn=3>โ</fn>") - , ("overcast","<fn=3>โ</fn>") - , ("partly cloudy", "<fn=3>โ
</fn>") - , ("mostly cloudy", "<fn=3>โ</fn>") - , ("considerable cloudiness", "<fn=4>โ</fn>")] + [ ("", fc "gray60" $ fn 4 "๐") + , ("clear", fn 4 "๐ฃ") + , ("sunny", fn 4 "๐ฃ") + , ("mostly clear", fn 4 "๐ค") + , ("mostly sunny", fn 4 "๐ค") + , ("partly sunny", fn 3 "โ
") + , ("fair", fn 4 "๐") + , ("obscured", fn 4 "๐") -- ๐ซ + , ("cloudy", fn 3 "โ") + , ("overcast", fn 3 "โ") + , ("partly cloudy", fn 3 "โ
") + , ("mostly cloudy", fn 3 "โ") + , ("considerable cloudiness", fn 4 "โ")] (mkArgs p ["-t", tmp , "-L","10", "-H", "25"] ["-w", ""]) 18000 @@ -106,9 +106,9 @@ batt 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>" + , "-i", fn 2 "\9211" + , "-O", fn 2 " \9211" ++ " <timeleft> <watts>" + , "-o", fn 2 " ๐" ++ " <timeleft> <watts>" , "-H", "10", "-L", "7" , "-h", pHigh p, "-l", pLow p] 50 "batt0" @@ -133,7 +133,7 @@ diskArgs p = mkArgs p diskIO p = DiskIO [("nvme0n1p2" -- , "<fn=1>โ</fn> <readb> <fn=1>โ</fn> <writeb> <fn=1><totalbbar></fn>") - , "<readb> <writeb> <fn=0><totalbipat></fn>") + , "<readb> <writeb> <totalbipat>") ] (diskArgs p) 10 -- <fn=1>๐จ ๐
๐ ๐ฉ โ </fn> @@ -165,20 +165,12 @@ mail p = MailX [ ("I", "jao/inbox", pHigh p) ["-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") --- , ("<fc=darkseagreen3><fn=2>๐ </fn></fc>", "~/var/maildir/jao/xmobar") --- , ("<fc=sienna2><fn=2>๐ </fn></fc>", "~/var/maildir/bigml/inbox") --- , ("<fc=sienna4><fn=2>๐ </fn></fc>", "~/var/maildir/bigml/support") --- ] --- "mail" - masterVol = Volume "default" "Master" ["-t", "<status> <volume>" , "--", "-C", "black", "-c", "sienna4" - , "-O", "<fn=4>๐ง</fn>" -- ๐ง - , "-o", "<fn=4>๐</fn>"] 10 + , "-O", fn 4 "๐ง" + , "-o", fn 4 "๐"] 10 captureVol = Volume "default" "Capture" ["-t", "<volume>"] 10 diff --git a/src/lib/Music.hs b/src/lib/Music.hs index 3d298df..5544d50 100644 --- a/src/lib/Music.hs +++ b/src/lib/Music.hs @@ -3,14 +3,13 @@ module Music where import Xmobar import Monitors import qualified Bottom -import Config (defaultHeight, pIsLight) +import Config (defaultHeight, pIsLight, fc) import GMPDP (GMPDP(..)) mpris client width = Mpris2 client -- "clementine" -- - ["-t", " <fn=0><tracknumber>\ - \ <title> <fc=sienna4><artist></fc>\ - \ <album> <length></fn>" + ["-t", " <tracknumber> <title> " ++ fc "sienna4" "<artist>" + ++ " <album> <length>" , "-T", show width, "-E", "โฆ", "-M", "100", "-x", ""] 10 mprisConfig client p = Bottom.config [Run (mpris client 165)] "|mpris2|" p @@ -19,18 +18,14 @@ mpd = MPD [ "-W", "12", "-b", "โ", "-f", "โ", "-t" , " <lapsed> <fc=honeydew3><fn=5><bar></fn></fc>"] 10 -- fn=5 +mpdt' c0 c1 c2 = "<ppos>/<plength> " + ++ fc c0 "<title> " ++ fc c1 "<artist> " ++ fc c2 "<album>" + ++ " <composer> <date>" + mpdt light = if light - then "<ppos>/<plength> \ - \<fn=0><fc=darkolivegreen><title></fc></fn> \ - \<fn=0><fc=dodgerblue4><artist></fc> \ - \<fn=0><album></fn> \ - \<fc=burlywood4><composer></fc> <date></fn>" - else "<ppos>/<plength> \ - \<fn=0><fc=darkseagreen4><title></fc></fn> \ - \<fn=0><fc=darkslategray4><artist></fc> \ - \<fn=0><fc=burlywood4><album></fc></fn> \ - \<composer> <date></fn>" + then mpdt' "darkolivegreen" "dodgerblue4" "burlywood4" + else mpdt' "darkseagreen4" "darkslategray4" "burlywood4" autoMPD l lgt = AutoMPD [ "-T", l, "-E", "โฆ", "-W", "10", "-t", "<length> " ++ mpdt lgt] |