diff options
Diffstat (limited to 'src/Single.hs')
-rw-r--r-- | src/Single.hs | 100 |
1 files changed, 37 insertions, 63 deletions
diff --git a/src/Single.hs b/src/Single.hs index c8e5115..27179ef 100644 --- a/src/Single.hs +++ b/src/Single.hs @@ -1,103 +1,77 @@ import Xmobar import Config import Monitors -import Music (mpris, gpmd, mpdt) -memoratio = Memory ["-t","<usedratio>%", "-p", "2", "-W", "3"] 20 - -topProcL p = TopProc (p <~> ["-t" - , memTemp - ++ " · <mboth1> <mboth2> <mboth3> <mboth4>" - , "-w", "12", "-L" , "10", "-H", "80"]) 15 - where memTemp = if pIsLight p - then "<both1> <both2> <both3> <both4>" - else "<both1> <both2> <both3> <both4>" - -diskIOL p = DiskIO [("/", "<totalbipat>"), ("/home", "<totalbipat>")] - (diskArgs p) 10 +topProcL p = TopProc (p <~> args) 15 + where template = "<both1> <both2> <both3> <both4> " + ++ "· <mboth1> <mboth2> <mboth3> <mboth4>" + args = ["-t", template, "-w", "12", "-L" , "10", "-H", "80"] diskIOS p = DiskIO [("/", "<read> <write>")] (diskArgs p) 10 -mpd a p i = - MPDX [ "-W", "12", "-b", "░", "-f", "▒", "-t", "<statei> <remaining>" - , "--", "-p", p, "-P", fni "\xf144", "-Z", fni i, "-S", fni i] 20 a - -mpdMon = mpd "mpd" "6600" "\xf001" -mopMon = mpd "mopidy" "6669" "\xf1bc" - -cpuFreq' p = CpuFreq (p <~> ["-t" , "<avg>" - , "-L", "1", "-H", "2", "-S", "Off" , "-d", "2"]) 50 +cpuFreq' p = CpuFreq (p <~> args) 50 + where args = ["-t" , "<avg>" , "-L", "1", "-H", "2", "-d", "2"] -cpus p = MultiCpu (mkArgs p - ["--template" , "<autobar> <total>%" - , "-L", "50", "-H", "85", "-W", "0", "-w", "3" - , "-f", "0123456789"] - ["--fallback-icon-pattern", "<icon=load_%%.xpm/>"]) 10 - - -memory' = Memory [ "-t" ,"<usedbar> <usedratio>" - , "-p", "2", "-W", "0","-d", "1", "-f", "0123456789" - , "--", "--scale", "1024"] 20 +memory' = Memory args 20 + where template = "<used> <available>" + args = ["-t", template , "-p", "2", "-d", "1", "--", "--scale", "1024"] +master on off p = Volume "default" "Master" (args ++ ("--":ext)) 10 + where args = ["-t", "<status> <volume>"] + ext = ["-C", pForeground p, "-c", "sienna4", "-O", on, "-o", off] config p = (baseConfig p) { position = TopSize C 100 (defaultHeight - 2) - , font = "xft:Hack-8" - , textOffset = defaultHeight - 8 - , textOffsets = [defaultHeight - 9, defaultHeight - 9, - defaultHeight - 6, defaultHeight - 8, - defaultHeight - 8, defaultHeight - 8] - , alpha = if pIsLight p then 192 else 230 + , textOffset = offset + , textOffsets = [offset - 1, offset - 1, offset + 2 + , offset, offset + 1, offset, offset] + , bgColor = if pIsLight p then "gray94" else "black" + , alpha = 255 , border = FullB , commands = [ Run (topProcL p) , Run (load p) , Run (iconBatt p) - , Run (cpu p) --- , Run (cpus p) - , Run memory + , Run (cpuBars p) + , Run memory' , Run (diskU p) , Run (diskIOS p) - , Run brightness , Run (kbd p) , Run (coreTemp p) , Run (wireless p "wlp164s0") , Run (dynNetwork p) , Run (vpnMark "wg-mullvad") , Run tun0 - , Run (masterVol p) + , Run (master (dimi "\xf025") (dimi "\xf131") p) , Run captureVol , Run laTime , Run localTime , Run (cpuFreq' p) - , Run w -- LEGE, LEBL, KCV0 + , Run (weather' wt "EGPH" p) ] ++ extraCmds , template = trayT - ++ " |batt0|" ++ sep - -- ++ dimi "\xf26c" ++ sep - ++ "|bright|" ++ sep + ++ " |batt0| " ++ "<action=`toggle-app.sh nm-applet`>" - ++ " |wg-mullvad||tun0||wlp164s0wi|" + ++ " |wg-mullvad||tun0||wlp164s0wi|" ++ "</action>" - ++ " |dynnetwork| " ++ sep + ++ " |dynnetwork| " ++ "<action=`toggle-app.sh pasystray`>" ++ " |default:Master| " ++ dimi "\xf130" ++ " |default:Capture|" - ++ "</action>" ++ sep - ++ " |EGPH| " ++ sep + ++ "</action>" + ++ " |EGPH| " ++ eLog p ++ " {} " - ++ "|kbd|" ++ sep - ++ "|load|" ++ sep - ++ "|cpufreq|" ++ sep - ++ "|multicpu|" ++ sep - ++ "|multicoretemp|" ++ sep - ++ " |top| " ++ sep - ++ " " ++ fni "\xf0c9" ++ " |memory| " - ++ " |diskio| |disku| " ++ sep + ++ "|kbd|" + ++ " |multicpu|" + ++ " |cpufreq|" + ++ " |multicoretemp|" + ++ " |top| " + ++ dimi "\xf080" ++ " |memory| " + ++ dimi "\xf0a0" ++ "|diskio| |disku| " ++ " |datetime| " - ++ "|laTime| " - } where dimi = fc (pDim p) . fni - sep = " " - w = weather' "<skyConditionS> <tempC>° <weather>" "EGPH" p + ++ " |laTime| " + } where dimi = fc "grey50" . fn 7 + offset = defaultHeight - 8 + wt = "<skyConditionS> <tempC>° <windKmh>" ++ fn 5 "🌫" ++ " <weather>" isXmonad = pWm p == Just "xmonad" trayT = if isXmonad then "|tray|" else "" eLog p = if isXmonad then "|XMonadLog|" else fc (pHigh p) "|elog|" |