3 if [ "$1" = "i3" ]; then
5 elif [ "$1" = "sway" ]; then
8 echo "Usage: $0 {i3|sway} {switch|move} {prev|next} [follow]"
12 curr_ws
=$
("$msgcmd" -t get_workspaces | jq
-r '.[] | select(.focused==true).name')
13 [ "$curr_ws" -eq 1 ] && prev_ws
=10 || prev_ws
=$
((curr_ws-1
))
14 [ "$curr_ws" -eq 10 ] && next_ws
=1 || next_ws
=$
((curr_ws
+1))
18 if [ "$2" = "switch" ] ||
[ "$2" = "move" ]; then
20 if [ "$3" = "prev" ]; then
22 elif [ "$3" = "next" ]; then
25 echo "Usage: $0 $1 $2 {prev|next} [follow]"
29 echo "Usage: $0 $1 {switch|move} {prev|next} [follow]"
33 if [ "$op" = "switch" ]; then
34 i3 workspace
"$dest_ws"
35 elif [ "$op" = "move" ]; then
36 i3 move container to workspace
"$dest_ws"
37 if [ "$4" = "follow" ]; then
38 i3 workspace
"$dest_ws"