basic bar

This commit is contained in:
♥ Minnie ♥ 2023-04-28 20:46:53 +08:00
parent 56212616e5
commit 527c4db1af

View file

@ -1,30 +1,47 @@
import Xmobar import Xmobar
import System.Environment (getEnv)
import System.IO.Unsafe (unsafeDupablePerformIO)
-- | Candybar -- | Configuration
config :: Config config :: Config
config = defaultConfig config = defaultConfig
-- general settings -- general settings
{ font = "Fira Code Semi Bold 9" { font = "Fira Code Semi Bold 9"
, additionalFonts = [ ] , additionalFonts = [ "Symbols Nerd Font 2048-em 24" ]
, bgColor = "#282828" , bgColor = bg1
, fgColor = "#d4be98" , fgColor = fg0
, position = Static { xpos = 1920, ypos = 0, width = 2560, height = 24 } , position = Static { xpos = 1920, ypos = 0, width = 2560, height = 24 }
, iconRoot = homeDir <> "/.config/xmonad/icons"
-- commands to run -- commands to run
, commands = , commands =
[ Run $ XMonadLog [ Run $ XPropertyLog "_XMONAD_LOG_1"
, Run $ Com "uname" ["-r","-s"] "" 0
, Run $ Date "%a %b %_d %Y <fc=#d8a657>%H:%M:%S</fc>" "date" 10
, Run $ Weather "YPJT"
[ "-t", "Temp: <fc=#d3869b><tempC>C</fc> <fc=#7c6f64>|</fc> Wind: <fc=#a9b665><windKmh>km/h</fc> <fc=#7c6f64>|</fc> Humidity: <fc=#e78a4e><rh>%</fc>" ]
18000
] ]
-- format our bar -- format our bar
, sepChar = "%" , sepChar = "%"
, alignSep = "}{" , alignSep = "}{"
, template = "\59255 %XMonadLog%" , template = "<hspace=6/><fn=1>\59255</fn> <fc=#a9b665>%uname%</fc> <fc=#7c6f64>|</fc>%_XMONAD_LOG_1%}{%YPJT% <fc=#7c6f64>|</fc> %date%<hspace=6/>"
} }
-- | Get home directory -- | Gruvbox material
homeDir :: String bg0, bg1, fg0, fg1, red, orange, yellow, green, aqua, blue, purple :: String
homeDir = unsafeDupablePerformIO (getEnv "HOME") -- backgrounds
bg0 = "#1d2021"
bg1 = "#282828"
-- foregrounds
fg0 = "#d4be98"
fg1 = "#ddc7a1"
-- greys
grey0 = "#7c6f64"
-- colors
red = "#ea6962"
orange = "#e78a4e"
yellow = "#d8a658"
green = "#a9b665"
aqua = "#89b482"
blue = "#7daea3"
purple = "#d3869b"
main :: IO () main :: IO ()
main = configFromArgs config >>= xmobar main = configFromArgs config >>= xmobar