pi3-smart-workspace
A small i3 helper that makes $mod+1 the first workspace on the screen your mouse is on, instead of workspace 1 somewhere else entirely.
- Language
- Python
- Licence
- Apache-2.0
- Runs on
- Linux (i3)
With several monitors in i3, workspaces are numbered globally. Press $mod+1 and you jump to workspace 1, even if it lives on the left screen and you’re working on the right one. pi3-smart-workspace turns that around: the key picks the N-th workspace on the screen your mouse is on. $mod+1 is always the first workspace wherever the mouse is, and a multi-monitor setup feels a lot more coherent.
It reads your running i3 config and uses three things from it: output names (set $<var> <output>), workspace names, and the lines that bind a workspace to an output. The order of those lines decides which workspace is number 1, 2 and 3 on each screen. It can also move the focused window there, and follow it if you like.
The first version is from 2020.
Install
From the AUR or PyPI:
yay -S pi3-smart-workspace
pip install pi3-smart-workspace
It needs Python 3.14 and a running i3 session.
Setup
The easy way is to let it write the config itself:
pi3-smart-workspace init
It finds every active monitor through i3 and writes a folder with a workspaces.conf per output and a bindings.conf with $mod+N, $mod+Shift+N and $mod+Ctrl+N. Each output gets its own contiguous range of global numbers, and the index after the colon (for example 9:1) means “first workspace on this monitor”. Add the include lines init prints to your i3 config and reload with $mod+Shift+r.
If you’d rather bind the keys yourself, it looks like this:
bindsym $mod+1 exec --no-startup-id pi3-smart-workspace -i 1
bindsym $mod+Shift+1 exec --no-startup-id pi3-smart-workspace -i 1 -s
bindsym $mod+Ctrl+1 exec --no-startup-id pi3-smart-workspace -i 1 -s -k