i3 named workspaces
I recently improved my i3-wm configuration regarding the handling of workspaces. The idea is to have a quicker access to Firefox and Emacs, the main GUI tools I use for working. I initially added bindings to Urxvt terminal, but I happen to use it too much, so I cannot bind it to a particular workspace, they have to appear where ever I am :-)
Workspace names
set $wp_web 1: web set $wp_edit 2: emacs set $wp_work 3: work set $wp_1 1: web # cannot use $variable here ... set $wp_2 2: emacs set $wp_3 3: work assign [class="Firefox"] ? $wp_web assign [class="^Emacs$"] ? $wp_edit
Switching workspace
# Win+1, Win+2 ... bindcode Mod4+10 workspace $wp_1 bindcode Mod4+11 workspace $wp_2 bindcode Mod4+12 workspace $wp_3 bindcode Mod4+13 workspace 4 ... # quick Fn accesses # F1 is Firefox, always focus to it during quick switches. # Same for F2 and emacs bindsym F1 workspace $wp_1 ; [class="Firefox"] focus bindsym F2 workspace $wp_2 ; [class="Emacs"] focus bindsym F3 workspace $wp_3 bindsym F4 workspace 4 # skip F5 (refresh in Firefox) ... # quick back-and-forth with special key bindsym Menu workspace back_and_forth # I would prefer a back-and-forth *on output* # win-left/right bindcode Mod4+86 workspace next bindcode Mod4+82 workspace prev # Mouse switch 1: left 2: middle 3: right bindsym --whole-window Mod4+button1 workspace prev_on_output bindsym --whole-window Mod4+button2 workspace back_and_forth bindsym --whole-window Mod4+button3 workspace next_on_output
Moving workspaces and windows
# quick move bindsym Shift+F1 move workspace $wp_1 bindsym Shift+F2 move workspace $wp_2 bindsym Shift+F3 move workspace $wp_3 bindsym Shift+F4 move workspace 4 ... # MOVE+Next/Prior keys to move the workspace bindsym $Mod_move+Next move workspace next bindsym $Mod_move+Prior move workspace prev # Special key (UP/X) to move only window bindcode $Mod_move+66 move window to output right;focus output right # F12/F11 to move to hidden scratchpad / show it bindsym F12 move scratchpad bindsym F11 scratchpad show