Can't edit the above answer so here's how to use --primary
with xrandr:
--primary
will set a display to be primary, which will not affect which workspaces are on it, but can change where your systray icons are displayed if you've configured i3 to that effect.
I execute my xrandr commands in this way:
exec --no-startup-id xrandr --output HDMI-0 --off --output DVI-I-1 --mode 1280x1024 --pos 0x0 --rotate normal --output DVI-I-0 --primary --mode 1920x1200 --pos 1280x0 --rotate normal --output DVI-I-3 --off --output DVI-I-2 --off
That is, I give it a complete specification of my screens. The easiest way to find out what this should look like is to set up your screens the way you want, then use arandr
(a simple xrandr gui) to export the xrandr line (Layout->Save As). Note that arandr will not set --primary
for you. Do this yourself, immediately after the display you want to make primary.
You said you wanted --primary
to ensure workspace 1 goes on your primary monitor. This won't happen, but you're going to want to move your workspaces between monitors dynamically and this will let you achieve what you want:
# move current workspace between monitors
bindsym $mod+Control+h move workspace to output left
bindsym $mod+Control+j move workspace to output down
bindsym $mod+Control+k move workspace to output up
bindsym $mod+Control+l move workspace to output right
I also use these things to rename workspaces. I often do this to rename workspace 2 to 10, so that I can have workspaces on my second monitor go from 10 downwards.
# rename current workspace
bindsym $mod+Control+r exec i3-input -F 'rename workspace to "%s"' -P 'New name: '
If you give a workspace a name such as "5: ssh", you can still go to it only if you've changed your binds like this:
# switch to workspace
bindsym $mod+1 workspace number 1
bindsym $mod+2 workspace number 2
bindsym $mod+3 workspace number 3
bindsym $mod+4 workspace number 4
bindsym $mod+5 workspace number 5
bindsym $mod+6 workspace number 6
bindsym $mod+7 workspace number 7
bindsym $mod+8 workspace number 8
bindsym $mod+9 workspace number 9
bindsym $mod+0 workspace number 10