Last active
November 30, 2022 08:29
-
-
Save jamen/2d48bb172773894c6b5829a56e0d9685 to your computer and use it in GitHub Desktop.
Sway workspace helper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
workspace 1a output $left_display | |
workspace 2a output $left_display | |
workspace 3a output $left_display | |
workspace 4a output $left_display | |
workspace 5a output $left_display | |
workspace 6a output $left_display | |
workspace 7a output $left_display | |
workspace 8a output $left_display | |
workspace 9a output $left_display | |
workspace 1b output $right_display | |
workspace 2b output $right_display | |
workspace 3b output $right_display | |
workspace 4b output $right_display | |
workspace 5b output $right_display | |
workspace 6b output $right_display | |
workspace 7b output $right_display | |
workspace 8b output $right_display | |
workspace 9b output $right_display | |
bindsym $mod+z exec "~/.local/bin/traverse_workspace.sh prev" | |
bindsym $mod+x exec "~/.local/bin/traverse_workspace.sh next" | |
bindsym $mod+Ctrl+z exec "~/.local/bin/traverse_workspace.sh prev move" | |
bindsym $mod+Ctrl+x exec "~/.local/bin/traverse_workspace.sh next move" | |
bindsym $mod+1 workspace 1a; workspace 1b | |
bindsym $mod+2 workspace 2a; workspace 2b | |
bindsym $mod+3 workspace 3a; workspace 3b | |
bindsym $mod+4 workspace 4a; workspace 4b | |
bindsym $mod+5 workspace 5a; workspace 5b | |
bindsym $mod+6 workspace 6a; workspace 6b | |
bindsym $mod+7 workspace 7a; workspace 7b | |
bindsym $mod+8 workspace 8a; workspace 8b | |
bindsym $mod+9 workspace 9a; workspace 9b | |
bindsym $mod+Shift+1 move container workspace 1a; move container workspace 1b | |
bindsym $mod+Shift+2 move container workspace 2a; move container workspace 2b | |
bindsym $mod+Shift+3 move container workspace 3a; move container workspace 3b | |
bindsym $mod+Shift+4 move container workspace 4a; move container workspace 4b | |
bindsym $mod+Shift+5 move container workspace 5a; move container workspace 5b | |
bindsym $mod+Shift+6 move container workspace 6a; move container workspace 6b | |
bindsym $mod+Shift+7 move container workspace 7a; move container workspace 7b | |
bindsym $mod+Shift+8 move container workspace 8a; move container workspace 8b | |
bindsym $mod+Shift+9 move container workspace 9a; move container workspace 9b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
WORKSPACE=$(swaymsg -t get_outputs | jq -r '.[]|select(.focused).current_workspace') | |
INDEX=${WORKSPACE:0:1} | |
MONITOR=${WORKSPACE:1} | |
[ "$1" == "next" ] && NEXT_INDEX=$(expr $INDEX + 1) | |
[ "$1" == "prev" ] && NEXT_INDEX=$(expr $INDEX - 1) | |
[ $NEXT_INDEX -gt 9 ] || [ $NEXT_INDEX -lt 1 ] && NEXT_INDEX=1 | |
[ "$2" == "move" ] && swaymsg move container workspace $NEXT_INDEX$MONITOR | |
swaymsg workspace $NEXT_INDEX$MONITOR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment