Create bash file above and put it in your path. add these lines to your i3/config:
# change focus
bindsym $alt+$left exec i3-navigate-emacs left
bindsym $alt+$down exec i3-navigate-emacs down
bindsym $alt+$up exec i3-navigate-emacs up
bindsym $alt+$right exec i3-navigate-emacs right
# alternatively, you can use the cursor keys:
bindsym $alt+Left exec i3-navigate-emacs left
bindsym $alt+Down exec i3-navigate-emacs down
bindsym $alt+Up exec i3-navigate-emacs up
bindsym $alt+Right exec i3-navigate-emacs right
When you try and focus right with i3 it will first check if you have emacs focussed. If so it will try and navigate right in emacs. If that fails (which it will if you are in the rightmost pane in emacs) it will move the i3 focus to the right.
This means if you accidentally try and use i3 commands to move focus in emacs it will just work.
- jq used to parse the json and figure out the focussed window in i3
i3-msg
comes with i3, used to speak to i3emacsclient
used to speak to emacs- evil mode for emacs (I use the evil-move-right command in emacs, change it if you want I guess).
grep
(if you don't have grep on your system things probably aren't gonna work great here).
I love this. One thing I notice is a pretty notable latency compared to the default movements. Of course some latency is to be expected but I was wondering if anyone had had any luck speeding this up. Its such a great idea!