ags: sync

This commit is contained in:
end-4
2024-01-25 22:25:27 +07:00
parent ed24fe4ae3
commit 7e73e24dd8
64 changed files with 2674 additions and 1723 deletions
+23
View File
@@ -0,0 +1,23 @@
#!/bin/bash
# Get the current workspace number
current=$(swaymsg -t get_workspaces | gojq '.[] | select(.focused==true) | .num')
# Check if a number was passed as an argument
if [[ "$1" =~ ^[+-]?[0-9]+$ ]]; then
new_workspace=$((current + $1))
else
new_workspace=$((current + 1))
fi
# Check if the new workspace number is out of bounds
if [[ $new_workspace -lt 1 ]]; then
exit 0
fi
# Switch to the new workspace
if [[ $2 == 'move' ]]; then
swaymsg move container to workspace $new_workspace
else
swaymsg workspace $new_workspace
fi