(xmobar): create separate files for top and bottom bars

This commit is contained in:
frosty 2024-07-14 16:36:25 -04:00
parent 2b2ac95be8
commit 98846e4012
4 changed files with 63 additions and 26 deletions

View file

@ -0,0 +1,24 @@
import Xmobar
config :: Config
config =
defaultConfig
{ font = "Terminus 8",
textOffset = 0,
bgColor = "#121212",
fgColor = "#cccccc",
position = Bottom,
template = " %disk-root% %disk-home% <fc=#777777>|</fc> %local-ip% <fc=#777777>|</fc> %ssid% }{ %now-playing% <fc=#777777>|</fc> %volume% ",
commands =
[ Run XMonadLog,
Run $ Com "monitors" ["local_ip"] "local-ip" 6000,
Run $ Com "monitors" ["ssid"] "ssid" 6000,
Run $ Com "monitors" ["disk", "/"] "disk-root" 6000,
Run $ Com "monitors" ["disk", "/home"] "disk-home" 6000,
Run $ PipeReader "/tmp/pipe-volume" "volume",
Run $ PipeReader "/tmp/pipe-now-playing" "now-playing"
]
}
main :: IO ()
main = xmobar config

View file

@ -0,0 +1,24 @@
import Xmobar
config :: Config
config =
defaultConfig
{ font = "Terminus 8",
textOffset = 0,
bgColor = "#121212",
fgColor = "#cccccc",
position = Top,
template = " %XMonadLog% }{ \57958 %cpu% <fc=#777777>|</fc> \61381 %memory% <fc=#777777>|</fc> %load% <fc=#777777>|</fc> %battery% <fc=#777777>|</fc> <fc=#f7e83b>%date%</fc> ",
commands =
[ Run XMonadLog,
Run $ PipeReader "/tmp/pipe-volume" "volume",
Run $ Com "monitors" ["battery"] "battery" 3600,
Run $ Com "monitors" ["cpu"] "cpu" 50,
Run $ Com "monitors" ["memory"] "memory" 50,
Run $ Com "monitors" ["load"] "load" 100,
Run $ Date "%m/%d/%Y %H:%M:%S" "date" 10
]
}
main :: IO ()
main = xmobar config

View file

@ -1,24 +0,0 @@
import Xmobar
config :: Config
config = defaultConfig
{ font = "Terminus 8"
, textOffset = 0
, bgColor = "#121212"
, fgColor = "#cccccc"
, position = Top
, template = " %XMonadLog% }{ %network% <fc=#777777>|</fc> VOL %volume% <fc=#777777>|</fc> %battery% <fc=#777777>|</fc> CPU %cpu% <fc=#777777>|</fc> RAM %memory% <fc=#777777>|</fc> %load% <fc=#777777>|</fc> <fc=#f7e83b>%date%</fc> "
, commands =
[ Run XMonadLog
, Run $ Com "monitors" ["network"] "network" 6000
, Run $ PipeReader "/tmp/pipe-volume" "volume"
, Run $ Com "monitors" ["battery"] "battery" 3600
, Run $ Com "monitors" ["cpu"] "cpu" 50
, Run $ Com "monitors" ["memory"] "memory" 50
, Run $ Com "monitors" ["load"] "load" 600
, Run $ Date "%d/%m/%Y %H:%M:%S" "date" 10
]
}
main :: IO ()
main = xmobar config

View file

@ -16,8 +16,21 @@ executable xmonad
default-language: GHC2021 default-language: GHC2021
default-extensions: ImportQualifiedPost default-extensions: ImportQualifiedPost
executable xmobar executable xmobar-top
main-is: xmobar.hs main-is: xmobar-top.hs
ghc-options:
-O2 -Wall -Wcompat -Wincomplete-record-updates
-Wredundant-constraints -rtsopts -threaded -with-rtsopts=-N
build-depends:
, base
, xmobar >=0.48
default-language: GHC2021
default-extensions: ImportQualifiedPost
executable xmobar-bottom
main-is: xmobar-bottom.hs
ghc-options: ghc-options:
-O2 -Wall -Wcompat -Wincomplete-record-updates -O2 -Wall -Wcompat -Wincomplete-record-updates
-Wredundant-constraints -rtsopts -threaded -with-rtsopts=-N -Wredundant-constraints -rtsopts -threaded -with-rtsopts=-N