sway: add more workspace commands

- wsc (#Q) - move all numbered workspaces to the center
- wsn (#Y) - new named workspace
- wsr (#+Y) - rename current workspace
This commit is contained in:
Adam Gausmann 2024-08-09 13:40:35 -05:00
parent a8157d03fa
commit 906441df7a
4 changed files with 24 additions and 0 deletions

View file

@ -117,6 +117,7 @@ bindsym $mod+Ctrl+$kleft move workspace to output left
bindsym $mod+Ctrl+$kdown move workspace to output down
bindsym $mod+Ctrl+$kup move workspace to output up
bindsym $mod+Ctrl+$kright move workspace to output right
bindsym $mod+q exec wsc
bindsym $mod+f fullscreen toggle
bindsym $mod+Shift+space floating toggle
@ -160,6 +161,9 @@ bindsym $mod+Ctrl+$kws8 rename workspace to $ws8
bindsym $mod+Ctrl+$kws9 rename workspace to $ws9
bindsym $mod+Ctrl+$kws10 rename workspace to $ws10
bindsym $mod+y exec wsn
bindsym $mod+Ctrl+y exec wsr
mode "resize" {
bindsym $kleft resize shrink width 10 px or 10 ppt
bindsym $kdown resize grow height 10 px or 10 ppt

8
templates/bin/wsc Executable file
View file

@ -0,0 +1,8 @@
#!/bin/sh
FOCUSED="$(swaymsg -t get_outputs --raw | jq '.[] | select(.focused).name')"
for i in $(seq 1 10)
do
swaymsg "workspace $i; move workspace to output $FOCUSED"
done

6
templates/bin/wsn Executable file
View file

@ -0,0 +1,6 @@
#!/bin/sh
INP="$(wofi --dmenu -H 1 -W 5)"
[ -z "$INP" ] && exit
swaymsg "workspace \"$INP\""

6
templates/bin/wsr Executable file
View file

@ -0,0 +1,6 @@
#!/bin/sh
INP="$(wofi --dmenu -H 1 -W 5)"
[ -z "$INP" ] && exit
swaymsg "rename workspace to \"$INP\""