diff options
author | jao <jao@gnu.org> | 2020-08-08 00:54:00 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2020-08-08 00:54:00 +0100 |
commit | 41b05855906fc751eceb6ae699c524e22d1c84cf (patch) | |
tree | 3eea0ca82ef6d1ac7b6bcfb7d69881dfe6fc59e6 | |
parent | fb73fdfc8dc9162165787fd2060363333145b069 (diff) | |
download | xmobar-config-41b05855906fc751eceb6ae699c524e22d1c84cf.tar.gz xmobar-config-41b05855906fc751eceb6ae699c524e22d1c84cf.tar.bz2 |
fun with font awesome
-rw-r--r-- | src/TopC.hs | 40 | ||||
-rw-r--r-- | src/lib/Config.hs | 8 | ||||
-rw-r--r-- | src/lib/Monitors.hs | 31 |
3 files changed, 55 insertions, 24 deletions
diff --git a/src/TopC.hs b/src/TopC.hs index 12fb0de..3e5748a 100644 --- a/src/TopC.hs +++ b/src/TopC.hs @@ -18,56 +18,64 @@ pollMPD light = MPD [ "-T", "120", "-W", "10", "-E", "โฆ", "-t", tm, "--", "-p", "6600"] 20 where tm = " <remaining> " ++ mpdt light +-- mprisName = "MellowPlayer3" +mprisName = "spotifyd" + musicPipe = PipeReader "/tmp/music" "musicpipe" -music light = toggleMonitor "/tmp/mpris.st" musicPipe (autoMPD light) +musicMPRIS p = mpris p mprisName 180 + +-- music light = toggleMonitor "/tmp/mpris.st" musicPipe (pollMPD light) +music p = toggleMonitor "/tmp/mpris.st" (musicMPRIS p) (pollMPD (pIsLight p)) -- <fn=1> ๐ก </fn> config p = (baseConfig p) { position = TopSize C 100 (defaultHeight - 1) , textOffset = defaultHeight - 8 , textOffsets = [defaultHeight - 9, defaultHeight - 9, - defaultHeight - 6, defaultHeight - 8] + defaultHeight - 6, defaultHeight - 8, + -1, defaultHeight - 8] , border = FullB , alpha = 255 , commands = [ Run (topProcL p) , Run m , Run (thinkTemp p) - , Run (mail p) +-- , Run (mail p) , Run (cpuBars p) , Run memory , Run (diskU p) , Run (diskIOL p) - , Run brightness' +-- , Run brightness' , Run kbd - , Run (batt p) + , Run (miniBatt p) , Run (wireless p "wlp1s0") , Run (dynNetwork p) , Run proton0 , Run w -- LEGE, LEBL, KCV0 - , Run masterVol + , Run (masterVol p) , Run captureVol - , Run laTime +-- , Run laTime , Run localTime ] - , template = " |batt0| " - ++ "|bright| " + , template = " " + ++ "|batt0| " +-- ++ "|bright| " ++ "<action=`toggle-app.sh nm-applet`>|proton0||wlp1s0wi|</action> " ++ "|dynnetwork| " ++ "<action=`toggle-app.sh pasystray`>|default:Master| \ \|default:Capture|</action> " - ++ "<action=`toggle-pipe.sh /tmp/mpris.st`>|" ++ ma ++ "|</action>" - ++ fn 1 " |kbd|" + ++ "<action=`toggle-pipe.sh /tmp/mpris.st`>" ++ ma ++ "</action>" + ++ " |kbd|" ++ " {} " - ++ "|mail|" - ++ "|multicoretemp| " +-- ++ "|mail|" ++ "|multicpu| " + ++ "|multicoretemp| " ++ " |top| " ++ "|memory| " ++ fc "grey60" "|diskio|" ++ " |disku| " ++ " |EGPH| " - ++ fn 2 "๐ " ++ "|datetime| |laTime| " - } where m = music (pIsLight p) - ma = alias m + ++ fni "\xf017 " ++ "|datetime| " + } where m = music p + ma = fc "grey40" (fni "\xf001 ") ++ "|" ++ alias m ++ "|" w = (weather' "<skyConditionS> <tempC>ยฐ <weather>" "EGPH" p) main :: IO () diff --git a/src/lib/Config.hs b/src/lib/Config.hs index b4db0b9..0cc4f8b 100644 --- a/src/lib/Config.hs +++ b/src/lib/Config.hs @@ -1,6 +1,6 @@ module Config ( Palette(..), baseConfig, palette, (<~>), (>~<), - mkArgs, defaultHeight, fc, fn) + mkArgs, defaultHeight, fc, fn, fni) where import System.Environment (lookupEnv) @@ -24,6 +24,7 @@ data Palette = Palette { pNormal :: String fc color thing = "<fc=" ++ color ++ ">" ++ thing ++ "</fc>" fn n thing = "<fn=" ++ show n ++ ">" ++ thing ++ "</fn>" +fni = fn 6 lightTheme :: IO Bool lightTheme = fmap (== Just "light") (lookupEnv "JAO_COLOR_SCHEME") @@ -61,7 +62,7 @@ darkPalette = Palette { pNormal = zenburnFg , pBorder = "black" -- zenburnBackLight , pForeground = zenburnFg , pBackground = doomBack -- zenburnBack - , pAlpha = 100 + , pAlpha = 0 , pIconRoot = icons "dark" , pIsLight = False } @@ -81,7 +82,8 @@ baseConfig p = defaultConfig { , "xft:Symbola-10" , "xft:Symbola-11" , "xft:Symbola-11" - , "xft:Hack-7"] + , "xft:Hack-7" + , "xft:FontAwesome-9"] , border = NoBorder , alpha = pAlpha p , overrideRedirect = True diff --git a/src/lib/Monitors.hs b/src/lib/Monitors.hs index a7dbf9a..99cd1ce 100644 --- a/src/lib/Monitors.hs +++ b/src/lib/Monitors.hs @@ -48,7 +48,8 @@ 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" , fc (pLow p) (fni "\xf1eb " ++ "<essid>") + -- <quality> , "-W", "5", "-M", "15" , "-m", "3" , "-L", "20", "-H", "80"]) 20 @@ -112,6 +113,24 @@ batt p = , "-H", "10", "-L", "7" , "-h", pHigh p, "-l", pLow p] 50 "batt0" +miniBatt p = + BatteryN ["BAT0"] + ["-t", "<acstatus>" + , "-S", "Off", "-d", "0", "-m", "3" + , "-L", "10", "-H", "90", "-p", "3" + , "-W", "0", "-f", + "\xf244\xf243\xf243\xf243\xf242\xf242\xf242\xf241\xf241\xf240" + , "--low", pHigh p, "--normal", pNormal p, "--high", pLow p + , "--" + , "-P" + , "-a", "notify-send -u critical 'Battery running out!!!!!!'" + , "-A", "5" + , "-i", fni "\xf1e6" + , "-O", fni "<leftbar> \xf1e6" ++ " <timeleft>" + , "-o", fni "<leftbar>" ++ " <timeleft>" + , "-H", "10", "-L", "7" + , "-h", pHigh p, "-l", pLow p] 50 "batt0" + thinkTemp p = MultiCoreTemp (mkArgs p ["-t", "<core1>ยฐC", "-L", "40", "-H", "70", "-d", "0"] @@ -156,19 +175,21 @@ masterVol p = Volume "default" "Master" ["-t", "<status> <volume>" , "--", "-C", pForeground p, "-c", "sienna4" - , "-O", fn 2 "๐ง" - , "-o", fn 4 "๐"] 10 + , "-O", fni "\xf025" -- "\xf130" -- fn 2 "๐ง" + , "-o", fn 4 "๐" + ] 10 captureVol = Volume "default" "Capture" ["-t", "<volume>"] 10 -kbd = Kbd [("us", ""), ("us(intl)", " โฃ")] +kbd = Kbd [("us", ""), ("us(intl)", fni " \xf11c")] -- " โฃ" brightness = Brightness ["--", "-D", "intel_backlight"] 10 brightness' = Brightness ["--", "-D", "amdgpu_bl0", "-C", "brightness"] 10 memory = Memory ["-t","<available> M", "-p", "2", "-W", "7"] 20 -netdev name = Network name ["-t", "<up>", "-x", "", "--", "--up", fn 2 "๐ "] 20 +netdev name = + Network name ["-t", "<up>", "-x", "", "--", "--up", fni "\xf0e8 "] 20 -- fn 2 "๐ " proton0 = netdev "proton0" laTime = DateZone "%H" "en_US" "US/Pacific" "laTime" 10 |