i3wm: more than 10 workspaces with double modifier key?

i3 does not really support key sequences like vim. Any key binding consists of a single key preceded by an optional list of distinct (so no Shift+Shift) modifiers. And all of the modifiers need to be pressed down at the time the main key is pressed.

That being said, there are two main ways to have a lot of workspaces without having to bind them to long lists of modifiers:

1. Dynamically create and access workspaces with external programs

You can do not have to define a shortcut for every single workspace, you can just create them on the fly by sending a workspace NEW_WS to i3, for example with the i3-msg program:

i3-msg workspace NEW_WS
i3-msg move container to workspace NEW_WS

i3 also comes with the i3-input command, which opens a small input field then runs a command with the given input as parameter

i3-input -F 'workspace %s' -P 'go to workspace: '
i3-input -F 'move container to workspace %s' -P 'move to workspace: '

Bind these these two commands to shortcuts and you can access an arbitrary number of workspaces by just pressing the shortcut and then entering the name (or number) of the workspace you want. (If you only work with numbered workspaces, you might want to use workspace number %s instead of just workspace %s)

2. Statically bind workspaces to simple Shortcuts within key binding modes

Alternatively, for a more static approach, you could use modes in your i3 configuration. You could have separate modes for focusing and moving to workspaces:

set $mode_workspace "goto_ws"
mode $mode_workspace {
    bindsym 1 workspace 1; mode "default"
    bindsym 2 workspace 2; mode "default"
    # […]
    bindsym a workspace a; mode "default"
    bindsym b workspace b; mode "default"
    # […]
    bindsym Escape mode "default"
}
bindsym $mod+w mode $mode_workspace

set $mode_move_to_workspace "moveto_ws"
mode $mode_move_to_workspace {
    bindsym 1 move container to workspace 1; mode "default"
    bindsym 2 move container to workspace 2; mode "default"
    # […]
    bindsym a move container to workspace a; mode "default"
    bindsym b move container to workspace b; mode "default"
    # […]
    bindsym Escape mode "default"
}
bindsym $mod+shift+w mode $mode_move_to_workspace

Or you could have separate bindings for focusing and moving within a single mode:

set $mode_ws "workspaces"
mode $mode_ws {
    bindsym 1 workspace 1; mode "default"
    bindsym Shift+1 move container to workspace 1; mode "default"
    bindsym 2 workspace 2; mode "default"
    bindsym Shift+2 move container to workspace 2; mode "default"
    # […]
    bindsym a workspace a; mode "default"
    bindsym Shift+a move container to workspace a; mode "default"
    bindsym b workspace b; mode "default"
    bindsym Shift+b move container to workspace b; mode "default"
    # […]
    bindsym Escape mode "default"
}
bindsym $mod+shift+w mode $mode_move_to_workspace

In both examples the workspace or move commands are chained with mode "default", so that i3 automatically returns back to the default key binding map after each command.


My solution to this is just using more keys:

set $ws0 "0:`:www"
set $ws1 "1:1"
set $ws2 "2:2"
set $ws3 "3:3:fm"
set $ws4 "4:4"
set $ws5 "5:5"
set $ws6 "6:6:dev"
set $ws7 "7:7"
set $ws8 "8:8"
set $ws9 "9:9"
set $ws10 "10:0:music"
set $ws11 "11:-:jd"
set $ws12 "12:=:comm"
set $ws13 "13:B"
set $ws14 "14:H"
set $ws15 "15:E"
set $ws16 "16:I"
set $ws17 "17:D:upwork"


bindsym $mod+grave workspace $ws0
bindsym $mod+1 workspace $ws1
bindsym $mod+2 workspace $ws2
bindsym $mod+3 workspace $ws3
bindsym $mod+4 workspace $ws4
bindsym $mod+5 workspace $ws5
bindsym $mod+6 workspace $ws6
bindsym $mod+7 workspace $ws7
bindsym $mod+8 workspace $ws8
bindsym $mod+9 workspace $ws9
bindsym $mod+0 workspace $ws10
bindsym $mod+minus workspace $ws11
bindsym $mod+equal workspace $ws12
bindsym $mod+BackSpace workspace $ws13
bindsym $mod+Home workspace $ws14
bindsym $mod+End workspace $ws15
bindsym $mod+Insert workspace $ws16
bindsym $mod+Delete workspace $ws17

for_window [class="Upwork"] move container to workspace $ws17
for_window [class="Spotify"] move container to workspace $ws10
for_window [class="Brave-browser"] move container to workspace $ws0
for_window [class="TelegramDesktop"] move container to workspace $ws12
for_window [class="jetbrains-pycharm"] move container to workspace $ws6
for_window [class="Caja"] move container to workspace $ws3
for_window [class="JDownloader"] move container to workspace $ws11