As for the key bindings, use additionalKeys
(from the module XMonad.Util.EZConfig).
Here are some key bindings I use (maybe you need some more imports to make everything work):
defaultConfig
{
-- stuff
} `additionalKeys`
[ ((0, xK_Print), spawn "scrot")
, ((mod1Mask, xK_Print), spawn "scrot -m -d 1")
, ((mod1Mask .|. shiftMask, xK_t), spawn "killall trayer && trayer --edge top --align right --SetDockType true --SetPartialStrut true --expand true --transparent true --width 5 --alpha 255 --tint 0x191970 --height 17")
, ((mod1Mask, xK_p), spawn "dmenu_run")
, ((mod1Mask, xK_b ), sendMessage ToggleStruts)
, ((mod1Mask, xK_m ), focusUrgent)
, ((mod1Mask, xK_n ), D.dzen "Hi, mom!" (seconds 4))
, ((mod1Mask, xK_f ), goToSelected defaultGSConfig)
, ((mod4Mask, xK_l ), spawn "cmus-remote -n ") --next song
, ((mod4Mask, xK_h ), spawn "cmus-remote -r") --previous song
, ((mod4Mask, xK_s ), spawn "cmus-remote -s") --stop
, ((mod4Mask, xK_p ), spawn "cmus-remote -p") --play
, ((mod4Mask, xK_Right ), spawn "cmus-remote -k +5") --forward 5 sec
, ((mod4Mask, xK_Left ), spawn "cmus-remote -k -5") --rewind 5 sec
, ((mod4Mask, xK_KP_Subtract ), spawn "amixer -q sset PCM 2dB-") --quieter
, ((mod4Mask, xK_KP_Add ), spawn "amixer -q sset PCM 2dB+") --louder
, ((mod1Mask .|. shiftMask, xK_udiaeresis), removeWorkspace)
, ((mod1Mask .|. shiftMask, xK_numbersign), selectWorkspace defaultXPConfig)
]
The D.dzen
comes from import qualified XMonad.Util.Dzen as D
. I don't use dzen as status bar but maybe looking into this module might give you some hints.
edit: here is a dzen config: And1's_xmonad.hs. Taken from this site with many examples: Config_archive.
edit2: I just played around a little with the new statusBar
function which is apparently quite new and came up with a working example.
edit3: removed the logHook as it isn't needed with statusBar
. main
now looks like this:
main = do
xmonad =<< statusBar "dzen2" myPP toggleStrutsKey
defaultConfig { --stuff
}
The keys
setting didn't work for me and I had to stick to additionalKeys
(don't forget the braces then):
main = do
xmonad =<< statusBar "dzen2" myPP toggleStrutsKey
(defaultConfig { --stuff
} `additionalKeys`
[ -- key bindings
])
Once I tidied my xmonad.hs I can also provide the whole file..