i3wm and tmux in a seamless experience.
Lately, I found myself working a lot with tmux on remote servers.
Although a custom tmux configuration let me manage panes in a semi-productive way, I still felt slow without i3wm.
I was looking for a way to manage tmux panes with i3wm as if they were local terminal windows.
i3tmux lets you do exactly this! Plus some goodies like sessions multiplexing, to keep the experience lag free1, and layout resumption.
You can check out the wiki to learn more about how i3tmux works (coming soon).
You can specify your preferred terminal emulator -- to spawn sessions windows -- with a dotfile at ~/.config/i3tmux/config.yaml
like this:
terminal:
bin: xterm
nameFlag: -name
To perform the main actions like add
and kill
a session or detach
a group, you can add the following shortcuts to your i3wm config file.
Here is an example2:
bindsym $caps+Shift+Return exec i3tmux --add
bindsym $caps+Shift+q exec i3tmux --kill
bindsym $caps+Shift+d exec i3tmux --detach
Host options are parsed from your ~/.ssh/config
file, so you are ready to go!
Each session is part of a group. You can create a new group with the following command:
i3tmux -host <host> -create <group_name>
To confirm that the group was created, you can list existing groups with the following:
i3tmux -host <host> -list
As you should see from the output, the create command also creates a session in the group.
To resume a group of sessions, you can use the following:
i3tmux -host <host> -resume <group_name>
When a group gets detached and resumed, its layout reestablished too.
You can quickly add (or kill) a session to a group by having the focus on a session window and using the shortcuts defined above.
Killing a window means also closing it remotely on the server.
You can simply detach a group by having the focus on a session window of the group and using the shortcut defined above.
Detaching means (locally) closing all the windows that belong to it and save its layout.
To install i3tmux you can either run make build
, and place the i3tmux
executable in a folder contained in $PATH
, or use go install
, and make sure that $GOBIN
is in $PATH
.
To run the tests just run make test
.
Podman
(or Docker
) is required to spawn isolated environments for tests.
This project is in alpha stage.
1: Being a network based interaction this is limited to RTT.
2: I remapped my caps lock to $caps
.