How to deal with I3wm muiti monitors

Hello friends,

I have read the documention on i3 quite a few times, but this is more of a workflow issue. So just switched to i3 on my desktop have been using it on laptop for a month or so. I run 4 monitors on my desktop and I am running out of workspaces quickly. by default with the 10 workspaces i only had 2ish per monitors at any time, I quickly found I needed more workspaces. So I just set up $mod+shift+(1-10) to a nother 10 workspaces, is there a cleaner way to do this. It works fine, but I feel like there has to be a more eligant way to do this.

Any ideas, how I have it works fine, but feel like there should be a better way to do this. 20 workspaces seems to be plenty, but 2 with a few spares wasn't I would like to be able to have 10 per monitor, I know I wouldn't use them all, but it would be nice to have.

Thanks for any feedback or ideas.

I use $mod+F1-F12 for additional workspaces.

I suppose you could have this a bit more on the scripted side. Bare with me for an moment

So, set up 40 workspaces. 10 for each monitor. name them something like mon<number>-ws<workspacenumber> ex: mon1-ws1

So, $mod+1 executes a script that changes monitor 1 to mon1-ws1, monitor 2 to mon2-ws1 etc...

This would give you more access. The other option would be to use your alt, shift, ctrl keys to get more workspaces. The downside is that this script will set your system up to keep all monitors synchronized to the same workspace, basically, you can't mix and match workspaces across monitors.

I wish I had a better solution, but this is what I could come up with short-term.

So I hasd a similar idea to using F1-F12, So I use alt key for mod and I use super for a 2ed mod pretty much, so in my i3 config I have
#alt
set $mod Mod1
#super/windows
set $sup Mod4

I use my super key to launch programs and I use mod for i3 defaults and workspaces. So After posting this I desided to use my $sup+1-0 for screen 1 then $sup+Shift+1-0 for screen 2 and screen 3 and 4 are on mod the same say if that makes since. This allows 40 workspaces it is still a bit sloppy. I like the script sided idea, but locked workspaces seems like a hassle more than just sloppy key binding. I Have my frist 4 locked just becasue they cant really move. This is working so far and it is pretty clean, I may really like this sloution once i get use to the keybindings.

I use the following monstrosity atm. Found it on reddit I think in /r/unixporn. The references to your monitors can probably be found in X11 conf or via xrandr. I chose slash since I use /buffer # in weechat. So it adds some consistency between the programs. The left and right workspaces based on which hand hits which key on the keyboard, asdf for left monitor and jkl for right monitor etc.

set $left_monitor DP-1
set $right_monitor DP-5
bindsym $mod+slash mode "$mode_chooser"
set $mode_chooser Choose workspace
mode "$mode_chooser" {
    bindsym Escape mode "default"
    bindsym 1 workspace "1" move workspace to output $left_monitor, mode "default"
    bindsym 2 workspace "2" move workspace to output $left_monitor, mode "default"
    bindsym 3 workspace "3" move workspace to output $left_monitor, mode "default"
    bindsym 4 workspace "4" move workspace to output $left_monitor, mode "default"
    bindsym 5 workspace "5" move workspace to output $left_monitor, mode "default"
    bindsym 6 workspace "6" move workspace to output $left_monitor, mode "default"
    bindsym 7 workspace "7" move workspace to output $right_monitor, mode "default"
    bindsym 8 workspace "8" move workspace to output $right_monitor, mode "default"
    bindsym 9 workspace "9" move workspace to output $right_monitor, mode "default"
    bindsym 0 workspace "0" move workspace to output $right_monitor, mode "default"
    bindsym a workspace "a" move workspace to output $left_monitor, mode "default"
    bindsym b workspace "b" move workspace to output $left_monitor, mode "default"
    bindsym c workspace "c" move workspace to output $left_monitor, mode "default"
    bindsym d workspace "d" move workspace to output $left_monitor, mode "default"
    bindsym e workspace "e" move workspace to output $left_monitor, mode "default"
    bindsym f workspace "f" move workspace to output $left_monitor, mode "default"
    bindsym g workspace "g" move workspace to output $left_monitor, mode "default"
    bindsym h workspace "h" move workspace to output $right_monitor, mode "default"
    bindsym i workspace "i" move workspace to output $right_monitor, mode "default"
    bindsym j workspace "j" move workspace to output $right_monitor, mode "default"
    bindsym k workspace "k" move workspace to output $right_monitor, mode "default"
    bindsym l workspace "l" move workspace to output $right_monitor, mode "default"
    bindsym m workspace "m" move workspace to output $right_monitor, mode "default"
    bindsym n workspace "n" move workspace to output $right_monitor, mode "default"
    bindsym o workspace "o" move workspace to output $right_monitor, mode "default"
    bindsym p workspace "p" move workspace to output $right_monitor, mode "default"
    bindsym q workspace "q" move workspace to output $left_monitor, mode "default"
    bindsym r workspace "r" move workspace to output $left_monitor, mode "default"
    bindsym s workspace "s" move workspace to output $left_monitor, mode "default"
    bindsym t workspace "t" move workspace to output $left_monitor, mode "default"
    bindsym u workspace "u" move workspace to output $right_monitor, mode "default"
    bindsym v workspace "v" move workspace to output $left_monitor, mode "default"
    bindsym w workspace "w" move workspace to output $left_monitor, mode "default"
    bindsym x workspace "x" move workspace to output $left_monitor, mode "default"
    bindsym y workspace "y" move workspace to output $right_monitor, mode "default"
    bindsym z workspace "z" move workspace to output $left_monitor, mode "default"
}
bindsym $mod+Shift+slash mode "$mode_mover"
set $mode_mover Move to workspace
mode "$mode_mover" {
    bindsym Escape mode "default"
    bindsym 1 move container to workspace "1"; workspace "1" move workspace to output $left_monitor, mode "default"
    bindsym 2 move container to workspace "2"; workspace "2" move workspace to output $left_monitor, mode "default"
    bindsym 3 move container to workspace "3"; workspace "3" move workspace to output $left_monitor, mode "default"
    bindsym 4 move container to workspace "4"; workspace "4" move workspace to output $left_monitor, mode "default"
    bindsym 5 move container to workspace "5"; workspace "5" move workspace to output $left_monitor, mode "default"
    bindsym 6 move container to workspace "6"; workspace "6" move workspace to output $left_monitor, mode "default"
    bindsym 7 move container to workspace "7"; workspace "7" move workspace to output $right_monitor, mode "default"
    bindsym 8 move container to workspace "8"; workspace "8" move workspace to output $right_monitor, mode "default"
    bindsym 9 move container to workspace "9"; workspace "9" move workspace to output $right_monitor, mode "default"
    bindsym 0 move container to workspace "0"; workspace "0" move workspace to output $right_monitor, mode "default"
    bindsym a move container to workspace "a"; workspace "a" move workspace to output $left_monitor, mode "default"
    bindsym b move container to workspace "b"; workspace "b" move workspace to output $left_monitor, mode "default"
    bindsym c move container to workspace "c"; workspace "c" move workspace to output $left_monitor, mode "default"
    bindsym d move container to workspace "d"; workspace "d" move workspace to output $left_monitor, mode "default"
    bindsym e move container to workspace "e"; workspace "e" move workspace to output $left_monitor, mode "default"
    bindsym f move container to workspace "f"; workspace "f" move workspace to output $left_monitor, mode "default"
    bindsym g move container to workspace "g"; workspace "g" move workspace to output $left_monitor, mode "default"
    bindsym h move container to workspace "h"; workspace "h" move workspace to output $right_monitor, mode "default"
    bindsym i move container to workspace "i"; workspace "i" move workspace to output $right_monitor, mode "default"
    bindsym j move container to workspace "j"; workspace "j" move workspace to output $right_monitor, mode "default"
    bindsym k move container to workspace "k"; workspace "k" move workspace to output $right_monitor, mode "default"
    bindsym l move container to workspace "l"; workspace "l" move workspace to output $right_monitor, mode "default"
    bindsym m move container to workspace "m"; workspace "m" move workspace to output $right_monitor, mode "default"
    bindsym n move container to workspace "n"; workspace "n" move workspace to output $right_monitor, mode "default"
    bindsym o move container to workspace "o"; workspace "o" move workspace to output $right_monitor, mode "default"
    bindsym p move container to workspace "p"; workspace "p" move workspace to output $right_monitor, mode "default"
    bindsym q move container to workspace "q"; workspace "q" move workspace to output $left_monitor, mode "default"
    bindsym r move container to workspace "r"; workspace "r" move workspace to output $left_monitor, mode "default"
    bindsym s move container to workspace "s"; workspace "s" move workspace to output $left_monitor, mode "default"
    bindsym t move container to workspace "t"; workspace "t" move workspace to output $left_monitor, mode "default"
    bindsym u move container to workspace "u"; workspace "u" move workspace to output $right_monitor, mode "default"
    bindsym v move container to workspace "v"; workspace "v" move workspace to output $left_monitor, mode "default"
    bindsym w move container to workspace "w"; workspace "w" move workspace to output $left_monitor, mode "default"
    bindsym x move container to workspace "x"; workspace "x" move workspace to output $left_monitor, mode "default"
    bindsym y move container to workspace "y"; workspace "y" move workspace to output $right_monitor, mode "default"
    bindsym z move container to workspace "z"; workspace "z" move workspace to output $left_monitor, mode "default"
}
1 Like

Not a bad slolution, I may set it up using something like this

Mother of god

1 Like

this is the currrent solution.

# alt key
set $mod Mod1
# super/windows key
set $Sup Mod4
set $ws-1 "1:I"
set $ws-2 "2:II"
set $ws-3 "3:III"
set $ws-4 "4:IV"
set $ws-5 "5:V"
set $ws-6 "6:VI"
set $ws-7 "7:VII"
set $ws-8 "8:VIII"
set $ws-9 "9:IX"
set $ws-10 "10:X"
set $ws-11 "11:I"
set $ws-12 "12:II"
set $ws-13 "13:III"
set $ws-14 "14:IV"
set $ws-15 "15:V"
set $ws-16 "16:VI"
set $ws-17 "17:VII"
set $ws-18 "18:VIII"
set $ws-19 "19:IX"
set $ws-20 "20:X"
set $ws-21 "21:I"
set $ws-22 "22:II"
set $ws-23 "23:III"
set $ws-24 "24:IV"
set $ws-25 "25:V"
set $ws-26 "26:VI"
set $ws-27 "27:VII"
set $ws-28 "28:VIII"
set $ws-29 "29:IX"
set $ws-30 "30:X"
set $ws-31 "31:I"
set $ws-32 "32:II"
set $ws-33 "33:III"
set $ws-34 "34:IV"
set $ws-35 "35:V"
set $ws-36 "36:VI"
set $ws-37 "37:VII"
set $ws-38 "38:VIII"
set $ws-39 "39:IX"
set $ws-40 "40:X"
# switch to workspace
bindsym $mod+1 workspace $ws-1
bindsym $mod+2 workspace $ws-2
bindsym $mod+3 workspace $ws-3
bindsym $mod+4 workspace $ws-4
bindsym $mod+5 workspace $ws-5
bindsym $mod+6 workspace $ws-6
bindsym $mod+7 workspace $ws-7
bindsym $mod+8 workspace $ws-8
bindsym $mod+9 workspace $ws-9
bindsym $mod+0 workspace $ws-10
bindsym $mod+ctrl+1 workspace $ws-11
bindsym $mod+ctrl+2 workspace $ws-12
bindsym $mod+ctrl+3 workspace $ws-13
bindsym $mod+ctrl+4 workspace $ws-14
bindsym $mod+ctrl+5 workspace $ws-15
bindsym $mod+ctrl+6 workspace $ws-16
bindsym $mod+ctrl+7 workspace $ws-17
bindsym $mod+ctrl+8 workspace $ws-18
bindsym $mod+ctrl+9 workspace $ws-19
bindsym $mod+ctrl+0 workspace $ws-20
bindsym $Sup+1 workspace $ws-21
bindsym $Sup+2 workspace $ws-22
bindsym $Sup+3 workspace $ws-23
bindsym $Sup+4 workspace $ws-24
bindsym $Sup+5 workspace $ws-25
bindsym $Sup+6 workspace $ws-26
bindsym $Sup+7 workspace $ws-27
bindsym $Sup+8 workspace $ws-28
bindsym $Sup+9 workspace $ws-29
bindsym $Sup+0 workspace $ws-30
bindsym $Sup+ctrl+1 workspace $ws-31
bindsym $Sup+ctrl+2 workspace $ws-32
bindsym $Sup+ctrl+3 workspace $ws-33
bindsym $Sup+ctrl+4 workspace $ws-34
bindsym $Sup+ctrl+5 workspace $ws-35
bindsym $Sup+ctrl+6 workspace $ws-36
bindsym $Sup+ctrl+7 workspace $ws-37
bindsym $Sup+ctrl+8 workspace $ws-38
bindsym $Sup+ctrl+9 workspace $ws-39
bindsym $Sup+ctrl+0 workspace $ws-40
# move focused container to workspace
bindsym $mod+Shift+1 move container to workspace $ws-1
bindsym $mod+Shift+2 move container to workspace $ws-2
bindsym $mod+Shift+3 move container to workspace $ws-3
bindsym $mod+Shift+4 move container to workspace $ws-4
bindsym $mod+Shift+5 move container to workspace $ws-5
bindsym $mod+Shift+6 move container to workspace $ws-6
bindsym $mod+Shift+7 move container to workspace $ws-7
bindsym $mod+Shift+8 move container to workspace $ws-8
bindsym $mod+Shift+9 move container to workspace $ws-9
bindsym $mod+Shift+0 move container to workspace $ws-10
bindsym $mod+Shift+ctrl+1 move container to workspace $ws-11
bindsym $mod+Shift+ctrl+2 move container to workspace $ws-12
bindsym $mod+Shift+ctrl+3 move container to workspace $ws-13
bindsym $mod+Shift+ctrl+4 move container to workspace $ws-14
bindsym $mod+Shift+ctrl+5 move container to workspace $ws-15
bindsym $mod+Shift+ctrl+6 move container to workspace $ws-16
bindsym $mod+Shift+ctrl+7 move container to workspace $ws-17
bindsym $mod+Shift+ctrl+8 move container to workspace $ws-18
bindsym $mod+Shift+ctrl+9 move container to workspace $ws-19
bindsym $mod+Shift+ctrl+0 move container to workspace $ws-20
bindsym $Sup+Shift+1 move container to workspace $ws-21
bindsym $Sup+Shift+2 move container to workspace $ws-22
bindsym $Sup+Shift+3 move container to workspace $ws-23
bindsym $Sup+Shift+4 move container to workspace $ws-24
bindsym $Sup+Shift+5 move container to workspace $ws-25
bindsym $Sup+Shift+6 move container to workspace $ws-26
bindsym $Sup+Shift+7 move container to workspace $ws-27
bindsym $Sup+Shift+8 move container to workspace $ws-28
bindsym $Sup+Shift+9 move container to workspace $ws-29
bindsym $Sup+Shift+0 move container to workspace $ws-30
bindsym $Sup+Shift+ctrl+1 move container to workspace $ws-31
bindsym $Sup+Shift+ctrl+2 move container to workspace $ws-32
bindsym $Sup+Shift+ctrl+3 move container to workspace $ws-33
bindsym $Sup+Shift+ctrl+4 move container to workspace $ws-34
bindsym $Sup+Shift+ctrl+5 move container to workspace $ws-35
bindsym $Sup+Shift+ctrl+6 move container to workspace $ws-36
bindsym $Sup+Shift+ctrl+7 move container to workspace $ws-37
bindsym $Sup+Shift+ctrl+8 move container to workspace $ws-38
bindsym $Sup+Shift+ctrl+9 move container to workspace $ws-39
bindsym $Sup+Shift+ctrl+0 move container to workspace $ws-40

1 Like

Ah yes, the lovely i3WM with the entire alphabet for workspaces. @candybar golden nugget.