i3 does not respect xmodmap changes consistently

Viewed 17

The keyindicator for Caps Lock breaks if I use xmodmap to change Caps_Lock to Escape and Shift+Caps_Lock to Caps_Lock.

In particular this line breaks:

bindsym --release Caps_Lock exec pkill -SIGRTMIN+11 i3blocks

And this line restores expected behavior:

bindsym --release Shift+Caps_Lock exec pkill -SIGRTMIN+11 i3blocks

So I have prepared the following minimum reproducible bug to explain what I mean:

Take this as your i3/config:

bindsym $mod+Escape exec notify-send "mod + Escape pressed"
bindsym $mod+Caps_Lock exec notify-send "mod + Caps_Lock pressed"
bindsym --release Caps_Lock exec notify-send "Caps_Lock released"
bindsym --release Shift+Caps_Lock exec notify-send "Shift+Caps_Lock released"

Without any xmodmap modifications (that is, with all defaults) everything should work as expected, that is:

  1. Pressing $mod+Escape will give notification "mod + Escape pressed"
  2. Pressing $mod+Caps_Lock will give notification "mod + Caps_Lock pressed"
  3. Pressing and releasing Caps_Lock will give notification "Caps_Lock released"
  4. Pressing and releasing Shift+Caps_Lock will give notification "Shift+Caps_Lock released"

Now apply the xmodmap modifications with xmodmap -e 'clear Lock'; xmodmap -e "keycode 66 = Escape Caps_Lock" . With these modifications:

  1. Pressing $mod+Escape will give notification "mod + Escape pressed"
  2. Pressing $mod+Caps_Lock will give notification "mod + Escape pressed" (That is Caps_Lock is interpreted as Escape).
  3. Pressing and releasing Caps_Lock will give notification "Caps_Lock released" (That is Caps_Lock is interpreted as Caps_Lock).
  4. Pressing and releasing Shift+Caps_Lock will give notification "Shift+Caps_Lock released"

I feel Caps_Lock being interpreted as two different things is inconsistent.

So summary:

  1. $mod+key is interpreted as per xmodmap changes
  2. key is interpreted as per defaults (without any xmodmap changes)

So my questions is: I want i3 to sensibly and consistently respect changes applied through xmodmap. Is there a way to do that?

p.s.: I have asked a similar question on the discussions page of i3 here. Asking again on Stackoverflow as I feel: 1. i3 is a popular topic on SO and not everyone on SO may visit i3 github page. 2. The above discussion need not be limited to users who visit i3 github page. I feel users elsewhere may add valuable inputs to the above discussion. 3. The above is not a discussion/ opinion question. There are clear software issues that can be fixed. Someone on SO may know the answer and this issue need not wait till it gets attention on i3 github page.

0 Answers
Related