Ich benutze gerne xmobar mit xmonad als Fenstermanager.
Beim Ändern der Konfiguration von xmonad verwende ich mod+ q, um die neue Konfiguration wirksam zu machen.
Dies funktioniert gut für xmonad, aber mir ist aufgefallen, dass xmobar seine Konfiguration nicht neu lädt.
Wie kann ich die Konfiguration von xmobar neu laden?
Meine aktuelle Konfiguration in xmonad.hs
ist
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")
]
Dies ist die Konfiguration von .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
}
arch-linux
xmonad
Matthias Braun
quelle
quelle