i3: Simulate monitor-independent workspaces
Often when I want to open a new workspace, I look at my bar to see which workspaces are still free. This does not work sometimes when having multiple monitors connected, as workspace numbers are unique between all outputs. Add a script that handles workspace switching/moving by prepending the index with the index of the current monitor.
This commit is contained in:
@@ -97,29 +97,17 @@ bindsym $mod+space focus mode_toggle
|
||||
# focus the parent container
|
||||
bindsym $mod+a focus parent
|
||||
|
||||
# Set workspace names
|
||||
set $ws1 "1"
|
||||
set $ws2 "2"
|
||||
set $ws3 "3"
|
||||
set $ws4 "4"
|
||||
set $ws5 "5"
|
||||
set $ws6 "6"
|
||||
set $ws7 "7"
|
||||
set $ws8 "8"
|
||||
set $ws9 "9"
|
||||
set $ws10 "10"
|
||||
|
||||
# switch to workspace
|
||||
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+1 exec ~/.config/i3/multi-monitor-workspaces.sh -s 1
|
||||
bindsym $mod+2 exec ~/.config/i3/multi-monitor-workspaces.sh -s 2
|
||||
bindsym $mod+3 exec ~/.config/i3/multi-monitor-workspaces.sh -s 3
|
||||
bindsym $mod+4 exec ~/.config/i3/multi-monitor-workspaces.sh -s 4
|
||||
bindsym $mod+5 exec ~/.config/i3/multi-monitor-workspaces.sh -s 5
|
||||
bindsym $mod+6 exec ~/.config/i3/multi-monitor-workspaces.sh -s 6
|
||||
bindsym $mod+7 exec ~/.config/i3/multi-monitor-workspaces.sh -s 7
|
||||
bindsym $mod+8 exec ~/.config/i3/multi-monitor-workspaces.sh -s 8
|
||||
bindsym $mod+9 exec ~/.config/i3/multi-monitor-workspaces.sh -s 9
|
||||
bindsym $mod+0 exec ~/.config/i3/multi-monitor-workspaces.sh -s 0
|
||||
|
||||
# switch back to the previous workspace
|
||||
workspace_auto_back_and_forth yes
|
||||
@@ -134,28 +122,28 @@ bindsym $mod+Shift+Tab exec i3-msg workspace "$( \
|
||||
head -1)"
|
||||
|
||||
# move focused container to workspace
|
||||
bindsym $mod+Shift+1 move container to workspace $ws1
|
||||
bindsym $mod+Shift+2 move container to workspace $ws2
|
||||
bindsym $mod+Shift+3 move container to workspace $ws3
|
||||
bindsym $mod+Shift+4 move container to workspace $ws4
|
||||
bindsym $mod+Shift+5 move container to workspace $ws5
|
||||
bindsym $mod+Shift+6 move container to workspace $ws6
|
||||
bindsym $mod+Shift+7 move container to workspace $ws7
|
||||
bindsym $mod+Shift+8 move container to workspace $ws8
|
||||
bindsym $mod+Shift+9 move container to workspace $ws9
|
||||
bindsym $mod+Shift+0 move container to workspace $ws10
|
||||
bindsym $mod+Shift+1 exec ~/.config/i3/multi-monitor-workspaces.sh -m 1
|
||||
bindsym $mod+Shift+2 exec ~/.config/i3/multi-monitor-workspaces.sh -m 2
|
||||
bindsym $mod+Shift+3 exec ~/.config/i3/multi-monitor-workspaces.sh -m 3
|
||||
bindsym $mod+Shift+4 exec ~/.config/i3/multi-monitor-workspaces.sh -m 4
|
||||
bindsym $mod+Shift+5 exec ~/.config/i3/multi-monitor-workspaces.sh -m 5
|
||||
bindsym $mod+Shift+6 exec ~/.config/i3/multi-monitor-workspaces.sh -m 6
|
||||
bindsym $mod+Shift+7 exec ~/.config/i3/multi-monitor-workspaces.sh -m 7
|
||||
bindsym $mod+Shift+8 exec ~/.config/i3/multi-monitor-workspaces.sh -m 8
|
||||
bindsym $mod+Shift+9 exec ~/.config/i3/multi-monitor-workspaces.sh -m 9
|
||||
bindsym $mod+Shift+0 exec ~/.config/i3/multi-monitor-workspaces.sh -m 0
|
||||
|
||||
# move focused container and switch to workspace
|
||||
bindsym Mod1+Shift+1 move container to workspace $ws1; workspace $ws1
|
||||
bindsym Mod1+Shift+2 move container to workspace $ws2; workspace $ws2
|
||||
bindsym Mod1+Shift+3 move container to workspace $ws3; workspace $ws3
|
||||
bindsym Mod1+Shift+4 move container to workspace $ws4; workspace $ws4
|
||||
bindsym Mod1+Shift+5 move container to workspace $ws5; workspace $ws5
|
||||
bindsym Mod1+Shift+6 move container to workspace $ws6; workspace $ws6
|
||||
bindsym Mod1+Shift+7 move container to workspace $ws7; workspace $ws7
|
||||
bindsym Mod1+Shift+8 move container to workspace $ws8; workspace $ws8
|
||||
bindsym Mod1+Shift+9 move container to workspace $ws9; workspace $ws9
|
||||
bindsym Mod1+Shift+0 move container to workspace $ws10; workspace $ws10
|
||||
bindsym Mod1+Shift+1 exec ~/.config/i3/multi-monitor-workspaces.sh -ms 1
|
||||
bindsym Mod1+Shift+2 exec ~/.config/i3/multi-monitor-workspaces.sh -ms 2
|
||||
bindsym Mod1+Shift+3 exec ~/.config/i3/multi-monitor-workspaces.sh -ms 3
|
||||
bindsym Mod1+Shift+4 exec ~/.config/i3/multi-monitor-workspaces.sh -ms 4
|
||||
bindsym Mod1+Shift+5 exec ~/.config/i3/multi-monitor-workspaces.sh -ms 5
|
||||
bindsym Mod1+Shift+6 exec ~/.config/i3/multi-monitor-workspaces.sh -ms 6
|
||||
bindsym Mod1+Shift+7 exec ~/.config/i3/multi-monitor-workspaces.sh -ms 7
|
||||
bindsym Mod1+Shift+8 exec ~/.config/i3/multi-monitor-workspaces.sh -ms 8
|
||||
bindsym Mod1+Shift+9 exec ~/.config/i3/multi-monitor-workspaces.sh -ms 9
|
||||
bindsym Mod1+Shift+0 exec ~/.config/i3/multi-monitor-workspaces.sh -ms 0
|
||||
|
||||
# reload the configuration file
|
||||
bindsym $mod+Shift+c reload
|
||||
|
||||
Reference in New Issue
Block a user