nix-configs/haskell/xmobar/xmobar.hs

45 lines
1.2 KiB
Haskell
Raw Normal View History

2023-12-06 19:07:14 +00:00
import Xmobar
2023-12-06 12:14:02 +00:00
-- TODOS:
-- - custom cpu module
-- - custom mem module
-- - custom network/ping module with avg of n pings and blah
-- - custom graph rendering based on braille characters
-- - custom "ramp" thingies
-- - newsticker?
-- - mail/message monitoring
-- - if possible, different bars per workspace
data CustomCpu = CustomCpu
deriving (Read, Show)
instance Exec CustomCpu where
alias CustomCpu = "cpu"
run CustomCpu = return "meow"
2023-12-06 19:07:14 +00:00
fc code content = "<fc=" ++ code ++ ">" ++ content ++ "</fc>"
2023-12-06 12:14:02 +00:00
2023-12-06 19:07:14 +00:00
sep = fc "#7c6f64"
icon = fc "#d65d0e"
config :: Config
config =
defaultConfig
{ font = "FiraCode Nerd Font",
allDesktops = True,
alpha = 255,
bgColor = "#282828",
fgColor = "#ebdbb2",
commands =
[ Run $ Memory ["t", "Mem: <usedratio>%"] 10,
Run $ CustomCpu,
2023-12-06 19:07:14 +00:00
Run $ Date (icon "\983277" ++ " %Y" ++ sep "-" ++ "%m" ++ sep "-" ++ "%d " ++ icon "\988236" ++ " %H" ++ sep ":" ++ "%M" ++ sep ":" ++ "%S ") "date" 10
],
template = "%memory% }{ %cpu% }{ %date%",
2023-12-06 19:07:14 +00:00
alignSep = "}{",
position = TopH 24
}
main :: IO ()
main = xmobar config -- or: configFromArgs config >>= xmobar