Я счастливо использую xmobar с xmonad в качестве моего оконного менеджера.
При изменении конфигурации xmonad я использую mod + q, чтобы сделать новую конфигурацию эффективной.
Это нормально работает для xmonad, но я заметил, что xmobar не перезагружает свою конфигурацию.
Как я могу перезагрузить конфигурацию xmobar?
Моя текущая конфигурация в xmonad.hs
import XMonad
import XMonad.Hooks.DynamicLog
import XMonad.Hooks.ManageDocks
import XMonad.Util.Run(spawnPipe)
import XMonad.Util.EZConfig(additionalKeys)
import System.IO
main = do
xmproc <- spawnPipe "xmobar"
xmonad $ defaultConfig {
manageHook = manageDocks <+> manageHook defaultConfig
, layoutHook = avoidStruts $
layoutHook defaultConfig
-- Without this, the xmonad pane would hide xmobar
-- From https://unix.stackexchange.com/questions/288037/xmobar-does-not-appear-on-top-of-window-stack-when-xmonad-starts/303242
, handleEventHook = handleEventHook defaultConfig <+> docksEventHook
, logHook = dynamicLogWithPP xmobarPP
{ ppOutput = hPutStrLn xmproc
, ppTitle = xmobarColor "green" "" . shorten 50
}
, modMask = mod4Mask -- Rebind Mod to the Windows key
, terminal = "urxvt"
, borderWidth = 1
, normalBorderColor = "#edf9ee"
, focusedBorderColor = "dark green"
, focusFollowsMouse = False
} `additionalKeys`
[
-- Toggle xmobar using mod + b
((mod4Mask, xK_b), sendMessage ToggleStruts)
-- Make a screenshot of the whole screen with the print key
, ((0, xK_Print), spawn "import -window root screenshot_$(date +%F_%H-%M-%S).png")
]
Это конфигурация из .xmobarrc
:
-- Configure the status bar for xmonad: https://wiki.archlinux.org/index.php/Xmobar
Config { font = "-*-Fixed-Bold-R-Normal-*-15-*-*-*-*-*-*-*"
, borderColor = "black"
, border = TopB
, bgColor = "blue"
, fgColor = "grey"
, position = TopW L 100
, commands = [ Run MultiCpu ["-t","Cpu: <total0> <total1> <total2> <total3>","-L","30","-H","60","-h","#FFB6B0","-l","#CEFFAC","-n","#FFFFCC","-w","3"] 10
, Run Memory ["-t","Mem: <usedratio>%"] 10
, Run Battery ["-t","Bat: <left>% / <timeleft>","-L","30","-H","60","-h","green","-n","yellow","-l","red"] 10
, Run Com "uname" ["-s","-r"] "" 36000
, Run Date "%a %F %H:%M" "date" 10
]
, sepChar = "%"
, alignSep = "}{"
, template = "%multicpu% | %memory% | %battery%}{<fc=#ee9a00>%date%</fc> | %uname% "
, hideOnStart = False
, persistent = True
}