From c94a9349d25394726456efc8b1dbcca8385b1b77 Mon Sep 17 00:00:00 2001 From: jao Date: Sat, 13 Aug 2022 05:43:40 +0100 Subject: xmobar-single: tidy-ups galore --- icons/light/load_0.xpm | 2 +- icons/light/load_1.xpm | 2 +- icons/light/load_2.xpm | 2 +- icons/light/load_3.xpm | 2 +- icons/light/load_4.xpm | 2 +- icons/light/load_5.xpm | 2 +- icons/light/load_6.xpm | 2 +- icons/light/load_7.xpm | 2 +- icons/light/load_8.xpm | 2 +- src/Single.hs | 100 ++++++++++++++++++------------------------------- src/lib/Config.hs | 17 +++------ src/lib/Monitors.hs | 5 ++- src/lib/Music.hs | 7 ++++ 13 files changed, 62 insertions(+), 85 deletions(-) diff --git a/icons/light/load_0.xpm b/icons/light/load_0.xpm index 258843c..e2a5a9a 100644 --- a/icons/light/load_0.xpm +++ b/icons/light/load_0.xpm @@ -3,7 +3,7 @@ static char *load_0[] = { "8 24 3 1", "# c #999999", " c white", -"! c #eeeeee", +"! c gray94", "!!!!!!!!", "!!!!!!!!", "!!!!!!!!", diff --git a/icons/light/load_1.xpm b/icons/light/load_1.xpm index b780d50..4516093 100644 --- a/icons/light/load_1.xpm +++ b/icons/light/load_1.xpm @@ -3,7 +3,7 @@ static char *load_1[] = { "8 24 3 1", "# c #999999", " c white", -"! c #eeeeee", +"! c gray94", "!!!!!!!!", "!!!!!!!!", "!!!!!!!!", diff --git a/icons/light/load_2.xpm b/icons/light/load_2.xpm index 68faefc..6e3dc44 100644 --- a/icons/light/load_2.xpm +++ b/icons/light/load_2.xpm @@ -1,7 +1,7 @@ /* XPM */ static char *load_2[] = { "8 24 3 1", -"! c #eeeeee", +"! c gray94", " c white", "# c #999999", "!!!!!!!!", diff --git a/icons/light/load_3.xpm b/icons/light/load_3.xpm index 5ee2a5a..faa17c7 100644 --- a/icons/light/load_3.xpm +++ b/icons/light/load_3.xpm @@ -3,7 +3,7 @@ static char *load_3[] = { "8 24 3 1", " c white", "# c #999999", -"! c #eeeeee", +"! c gray94", "!!!!!!!!", "!!!!!!!!", "!!!!!!!!", diff --git a/icons/light/load_4.xpm b/icons/light/load_4.xpm index 1db225b..82aa896 100644 --- a/icons/light/load_4.xpm +++ b/icons/light/load_4.xpm @@ -3,7 +3,7 @@ static char *load_4[] = { "8 24 3 1", " c white", "# c #999999", -"! c #eeeeee", +"! c gray94", "!!!!!!!!", "!!!!!!!!", "!!!!!!!!", diff --git a/icons/light/load_5.xpm b/icons/light/load_5.xpm index 4a4b2fa..7bec2b9 100644 --- a/icons/light/load_5.xpm +++ b/icons/light/load_5.xpm @@ -3,7 +3,7 @@ static char *load_5[] = { "8 24 3 1", "# c #999999", " c white", -"! c #eeeeee", +"! c gray94", "!!!!!!!!", "!!!!!!!!", "!!!!!!!!", diff --git a/icons/light/load_6.xpm b/icons/light/load_6.xpm index b743565..58aa4d4 100644 --- a/icons/light/load_6.xpm +++ b/icons/light/load_6.xpm @@ -1,7 +1,7 @@ /* XPM */ static char *load_6[] = { "8 24 3 1", -"! c #eeeeee", +"! c gray94", "# c #999999", " c white", "!!!!!!!!", diff --git a/icons/light/load_7.xpm b/icons/light/load_7.xpm index fd9845f..301301a 100644 --- a/icons/light/load_7.xpm +++ b/icons/light/load_7.xpm @@ -1,7 +1,7 @@ /* XPM */ static char *load_7[] = { "8 24 3 1", -"! c #eeeeee", +"! c gray94", "# c #999999", " c white", "!!!!!!!!", diff --git a/icons/light/load_8.xpm b/icons/light/load_8.xpm index 1bfc6cf..0841fd4 100644 --- a/icons/light/load_8.xpm +++ b/icons/light/load_8.xpm @@ -1,7 +1,7 @@ /* XPM */ static char *load_8[] = { "8 24 3 1", -"! c #eeeeee", +"! c gray94", "# c #999999", " c white", "!!!!!!!!", 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","%", "-p", "2", "-W", "3"] 20 - -topProcL p = TopProc (p <~> ["-t" - , memTemp - ++ " · " - , "-w", "12", "-L" , "10", "-H", "80"]) 15 - where memTemp = if pIsLight p - then " " - else " " - -diskIOL p = DiskIO [("/", ""), ("/home", "")] - (diskArgs p) 10 +topProcL p = TopProc (p <~> args) 15 + where template = " " + ++ "· " + args = ["-t", template, "-w", "12", "-L" , "10", "-H", "80"] diskIOS p = DiskIO [("/", " ")] (diskArgs p) 10 -mpd a p i = - MPDX [ "-W", "12", "-b", "░", "-f", "▒", "-t", " " - , "--", "-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" , "" - , "-L", "1", "-H", "2", "-S", "Off" , "-d", "2"]) 50 +cpuFreq' p = CpuFreq (p <~> args) 50 + where args = ["-t" , "" , "-L", "1", "-H", "2", "-d", "2"] -cpus p = MultiCpu (mkArgs p - ["--template" , " %" - , "-L", "50", "-H", "85", "-W", "0", "-w", "3" - , "-f", "0123456789"] - ["--fallback-icon-pattern", ""]) 10 - - -memory' = Memory [ "-t" ," " - , "-p", "2", "-W", "0","-d", "1", "-f", "0123456789" - , "--", "--scale", "1024"] 20 +memory' = Memory args 20 + where template = " " + args = ["-t", template , "-p", "2", "-d", "1", "--", "--scale", "1024"] +master on off p = Volume "default" "Master" (args ++ ("--":ext)) 10 + where args = ["-t", " "] + 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| " ++ "" - ++ " |wg-mullvad||tun0||wlp164s0wi|" + ++ " |wg-mullvad||tun0||wlp164s0wi|" ++ "" - ++ " |dynnetwork| " ++ sep + ++ " |dynnetwork| " ++ "" ++ " |default:Master| " ++ dimi "\xf130" ++ " |default:Capture|" - ++ "" ++ sep - ++ " |EGPH| " ++ sep + ++ "" + ++ " |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' " ° " "EGPH" p + ++ " |laTime| " + } where dimi = fc "grey50" . fn 7 + offset = defaultHeight - 8 + wt = " ° " ++ fn 5 "🌫" ++ " " isXmonad = pWm p == Just "xmonad" trayT = if isXmonad then "|tray|" else "" eLog p = if isXmonad then "|XMonadLog|" else fc (pHigh p) "|elog|" diff --git a/src/lib/Config.hs b/src/lib/Config.hs index 1840755..7e1b2bb 100644 --- a/src/lib/Config.hs +++ b/src/lib/Config.hs @@ -38,7 +38,7 @@ lightPalette = Palette { pNormal = "#000000" , pLow = "#4d4d4d" , pHigh = "#a0522d" , pDim = "#999999" - , pFont = "xft:Source Code Pro Medium-9" + , pFont = "xft:DejaVu Sans Mono-8" , pBorder = "#cccccc" , pForeground = "#000000" , pBackground = "#ffffff" @@ -61,13 +61,8 @@ darkPalette :: Palette darkPalette = Palette { pNormal = zenburnFg , pLow = "darkseagreen4" -- zenburnGreen , pHigh = zenburnRed - , pFont = "xft:DejaVu Sans Mono-9" --- , pFont = "xft:Noto Sans Mono Medium-9" --- , pFont = "xft:PragmataPro-9" --- , pFont = "xft:Source Code Pro Medium-9" --- , pFont = "xft:IosevkaCC-9" + , pFont = "xft:DejaVu Sans Mono-8" , pDim = "#7f7f7f" - -- , pFont = "xft:NotoMono-9,xft:Inconsolata-11" , pBorder = "#000000" -- zenburnBackLight , pForeground = zenburnFg , pBackground = doomBack -- zenburnBack @@ -94,10 +89,10 @@ baseConfig p = defaultConfig { , "xft:Symbola-10" , "xft:Symbola-11" , "xft:Symbola-11" - , "xft:DejaVu Sans Mono-9" --- , "xft:Noto Sans Mono Medium-9" --- , "xft:IosevkaCC-9" - , "xft:FontAwesome-10"] + , "xft:Symbola-12" + , "xft:FontAwesome-10" + , "xft:FontAwesome-9"] + , border = NoBorder , alpha = pAlpha p , overrideRedirect = True diff --git a/src/lib/Monitors.hs b/src/lib/Monitors.hs index 3cede52..f09631b 100644 --- a/src/lib/Monitors.hs +++ b/src/lib/Monitors.hs @@ -102,13 +102,14 @@ weather' tmp st p = , ("considerable cloudiness", fn 4 "⛈") , ("light rain", fn 4 "🌧") , ("rain", fn 4 "⛆") - , ("ice crystals", fn 3 "❄") + , ("ice crystals", snow) , ("light snow", fn 3 "🌨") - , ("snow", fn 3 "❄") + , ("snow", snow) ] (mkArgs p ["-t", tmp , "-L","10", "-H", "25" , "-T", "25", "-E", ".."] ["-w", ""]) 18000 + where snow = fni "\xf2dc" weather = weather' " ° % ()" diff --git a/src/lib/Music.hs b/src/lib/Music.hs index 13a52a2..a2698c9 100644 --- a/src/lib/Music.hs +++ b/src/lib/Music.hs @@ -30,6 +30,13 @@ mpdt light = autoMPD l lgt = AutoMPD [ "-T", l, "-E", "…", "-W", "10", "-t", " " ++ mpdt lgt] +mpdx a p i = + MPDX [ "-W", "12", "-b", "░", "-f", "▒", "-t", " " + , "--", "-p", p, "-P", fni "\xf144", "-Z", fni i, "-S", fni i] 20 a + +mpdMon = mpdx "mpd" "6600" "\xf001" +mopMon = mpdx "mopidy" "6669" "\xf1bc" + mpdConfig p = (Bottom.config [Run mpd, Run (autoMPD "150" (pIsLight p))] "|mpd| |autompd|" p) { -- cgit v1.2.3