mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 14:49:14 +00:00
88 lines
2.5 KiB
Haskell
88 lines
2.5 KiB
Haskell
import Xmobar
|
|
|
|
import Data.Function ((&))
|
|
import Data.List (intercalate)
|
|
|
|
config :: Config
|
|
config =
|
|
defaultConfig
|
|
{
|
|
-- as docked
|
|
overrideRedirect = False
|
|
|
|
-- For framework 13
|
|
, dpi = 150
|
|
, font = "Iosevka 8"
|
|
, fgColor = "#FFFFFF"
|
|
, bgColor = "#000000"
|
|
, position = BottomH 24
|
|
, textOffset = 2
|
|
|
|
, commands =
|
|
[ Run $ Date "%a %d %H:%M:%S" "hereClock" (1 &second)
|
|
, Run $ DateZone "%H:%M" "" "America/Aruba" "arubaClock" (10 &second)
|
|
, Run $ DateZone "%H:%M" "" "America/Montreal" "montrealClock" (10 &second)
|
|
, Run $ DateZone "%H:%M" "" "Europe/Paris" "cetClock" (10 &second)
|
|
, Run $ DateZone "%H:%M" "" "Asia/Taipei" "tstClock" (10 &second)
|
|
, Run $
|
|
Com
|
|
"tomorrow"
|
|
[ "--target", "2025-08-14"
|
|
, "--target", "2025-08-21"
|
|
]
|
|
""
|
|
(60 &minute)
|
|
, Run $
|
|
Battery
|
|
[ "-t", "<left> (<timeleft>"
|
|
, "-H", "70"
|
|
, "-L", "20"
|
|
, "-h", "green"
|
|
, "-n", "orange"
|
|
, "-l", "red"
|
|
, "--"
|
|
, "-P"
|
|
, "-A", "10"
|
|
-- TODO: File a bug upstream about notify-send
|
|
-- https://codeberg.org/xmobar/xmobar/issues/746
|
|
, "-a", "notify-send -u critical \"Battery Low\" \"Please charge your battery\""
|
|
]
|
|
(6 &second)
|
|
, Run $ Com "powerprofilesctl" ["get"] "" (6 &second)
|
|
, Run XMonadLog
|
|
, Run $
|
|
Weather
|
|
"RCSS"
|
|
[ "-t", "<station>: <tempC>°C"
|
|
, "-L","10", "-H", "25"
|
|
, "--normal", "white"
|
|
, "--high", "orange"
|
|
, "--low", "blue"
|
|
]
|
|
(15 &minute)
|
|
]
|
|
, template =
|
|
" %XMonadLog% "
|
|
<> alignSep config
|
|
<> intercalate "|"
|
|
[ unwords
|
|
[ "<fc=#c9c9c9>[AUA: %arubaClock%]</fc>"
|
|
, "<fc=#c9c9c9>[YUL: %montrealClock%]</fc>"
|
|
, "<fc=#c9c9c9>[CDG: %cetClock%]</fc>"
|
|
, "<fc=#c9c9c9>[TPE: %tstClock%]</fc>"
|
|
]
|
|
<> " "
|
|
, " %RCSS% "
|
|
, " %battery%, %powerprofilesctl%) "
|
|
, " %hereClock% (%tomorrow%) "
|
|
]
|
|
}
|
|
|
|
second :: Int -> Int
|
|
second = (* 10)
|
|
|
|
minute :: Int -> Int
|
|
minute = (* 60) . second
|
|
|
|
main :: IO ()
|
|
main = xmobar config
|