The issue here is that you are essentially removing the Windows keys from the modifier list with clear mod4
. In order to have Caps Lock available as an additional modifier instead as a replacement of the Window keys, you would have to set it to a different modifier. You can use modifiers Mod1
through Mod5
in addition to Control
, Shift
and Mode_switch
with i3.
First check, if any modifiers are unused in the the layout you are using (without applying your .Xmodmap
). You can get a list of the modifier settings with xmodmap -pm
. For the us
layout this returns (on my machine):
xmodmap: up to 4 keys per modifier, (keycodes in parentheses):
shift Shift_L (0x32), Shift_R (0x3e)
lock Caps_Lock (0x42)
control Control_L (0x25), Control_R (0x69)
mod1 Alt_L (0x40), Alt_R (0x6c), Meta_L (0xcd)
mod2 Num_Lock (0x4d)
mod3
mod4 Super_L (0x85), Super_R (0x86), Super_L (0xce), Hyper_L (0xcf)
mod5 ISO_Level3_Shift (0x5c), Mode_switch (0xcb)
As you can see mod3
is currently unused. In order to use it you just have to put the following into your .Xmodmap
:
clear lock
keycode 66 = Hyper_R
add mod3 = Hyper_R
Note: In this case I used Hyper_R
because Hyper_L
was already bound to mod4
. And 66 is the key code of Caps Lock. This may be different on your machine.
Now you can use this modifier with your i3 keybindings. If you want to keep using the $mod
variable with your configuration just set it to either Mod3
or Mod4
depending on if you want to use Caps Lock or the Windows keys for that. But There is no real need to actually use it (It is mainly convenience to ease up first time setup when choosing between Alt (Mod1
) and Windows keys (Mod4
).
Using the new Modifier is as simple as:
bindsym Mod3+s exec something
binysym Mod3+Mod4+s exec something_else
Do you want to use the windows key as Modifier or as (the last) key?
the modifier
Could you edit the question to show how you got Caps Lock to work as modifier? It is not something i3 can do by default, so I assume you remapped it (with xmodmap?) to some other key. Then would be the question if you want the Windows key to be the same modifier as Caps Lock or a different one.
I updated it.