Here is a very simple XMonad config I am starting with.
main :: IO ()
main = xmonad $ def
{ modMask = mod4Mask -- Rebind Mod to the Super key
terminal = "alacritty"
}
The only thing it does is:
How can I override the keybinding for launching a terminal? I am aware of the additionalKeysP thingy, it works, but it does not overrides the default keybindings, it just adds keybindings and I want to override the default instead of adding.
Please help :-)
It may not be straightforward, but you can overwrite default key like this:
`additionalKeysP`
[ ("M1-C-t", spawn "") -- Default key.
, ("M1-C-a", spawn "alacritty") -- New key for launching alacritty.
]
Function spawn "A"
execute command A
in a shell (e.g. spawn "ls -a"
execute shell command ls -a
). So you should rewrite spawn "alacritty"
to your favorite code launching alacritty.
I don't know well about shell command for launching alacritty.
I'm assuming:
modMask = mod4Mask
in your xmonad.hs.additionalKeysP
.Alt+Ctrl+t
for launching a terminal.Alt+Ctrl+a
.xmodmap
output is like this (It's important Alt
keys are contained group mod1
at now.):$ xmodmap
xmodmap: up to 4 keys per modifier, (keycodes in parentheses):
shift Shift_L (0x32), Shift_R (0x3e)
...
mod1 Alt_L (0x40), Alt_R (0x6c), Alt_L (0xcc), Meta_L (0xcd)
...
mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf)