switch binding mode automatically upon changing focus #3733
I'm submitting a…
[ ] Bug [x] Feature Request [ ] Documentation Request [ ] Other (Please describe in detail)
There is no obvious way to have different windows automatically use different keybindings when focused on them. For example, the closest thing would be something like
The motivation is that I want to alter the shortcut keys in chrome itself. For example, in Chrome, Ctrl+w closes a tab. The following makes it so I don't have to hold Ctrl, just pressing w will do it:
The mode itself and the bindsym command work fine, but I have to manually press a key to enter
but that is equivalent to not having the class criteria at all.
Have some kind of syntax like
Such that every time a window with that criteria is refocused, the mode is automatically activated. This will allow different window classes to have separate keybindings automatically, without having to manually press a button to toggle between them.
i3 version: 4.16.1
- Linux Distribution & Version: 5.2.0-arch2-1-ARCH - Are you using a compositor (e.g., xcompmgr or compton): no
thanks for raising this feature request! I can see the benefit for your usecase, but it seems that this could comfortably and without downsides be implemented as an external tool that just watches the focus and activates the proper mode (for example using the IPC). Given that I would recommend you choose this approach, you can always look to /r/i3wm if you need some help with writing such a script.
Within i3 this feels a bit like a workaround to reduce effort on implementing a feature we would probably implement differently, but dont actually intend on supporting anyway. Therefore I'll close this issue. Thanks for understanding!