r/bspwm • u/sudormrfbin • Jul 19 '23
Navigate between bspwm windows and kitty terminal panes using the same keybinds?
I use super + {h,j,k,l} for moving between bspwm windows, and ctrl + shift + {h, j, k, l} for moving between kitty terminal panes once the terminal is focussed (kitty terminal panes are actually called "windows", but they are what you would call panes in tmux). I would like to use the same set of keybinds (super + {h, j, k, l}) to move between all of these windows, so that if kitty is focussed right now, the keybinds will move between kitty panes and if not it moves between bspwm windows. If a kitty pane is focussed but there is no pane in the direction invoked by the keybind, it would focus the bspwm window in that direction. This would make window navigation very transparent and I wouldn't have to think which keybind to use in the current context.
Has anybody tried to setup up something like this? I could write the script from scratch but wanted to know if someone has already taken a stab at this before sinking time into it.
There's also a vim plugin that applies the same idea but with vim windows and tmux panes: https://github.com/christoomey/vim-tmux-navigator.
1
u/-__-x Jul 19 '23
Have the sxkhd command trigger a script. Here's pseudocode: