2

I am trying to create an effect with i3 and polybar to show the polybar tray whenever the $mod key is pressed, and hide it when $mode is released. I am using the hideIt.sh script to implement the window showing/hiding feature, and bindcode to bind the command in the i3 configuration. With the following configuration:

bindcode 133 exec hideIt.sh --name '^polybar-bottom_eDP-1$' --toggle
bindcode --release 133 exec hideIt.sh --name '^polybar-bottom_eDP-1$' --toggle

The functionality only works if I press and release only the $mod key (in this case the Windows key code is 133). Now, if I press, for example, $mod+2 to switch to my second workspace, the polybar is shown, but not hidden on release.

TL;DR is there any way to catch the $mod key release after a defined shortcut is pressed? Or, as a fallback, is there any way to bind to any key release event to hide the polybar after all keys are released? Thank you!

1
  • I'm using xdotool instead of the hideIt script but I'm having the same issue as you. Very annoying that you have to press the $mod key again for the polybar to go away
    – Spikatrix
    Jun 2, 2020 at 7:33

1 Answer 1

0

There is a (closed) bug thread referencing Super_L (and Alt_L) and --release not working.

This (bindcode --relase, bindsym --release) works for most keys other than Super_L; e.g. Caps_Lock (code 66). https://github.com/i3/i3/issues/2733#issuecomment-360442845

bindcode 66 exec notify-send "normal"
bindcode --release 66 exec notify-send "release"

The above configuration will issue notifications when caps lock is pressed and released, regardless if a key (like "a") is pressed or released alongside.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .