mirror of
https://github.com/xsghetti/HyprCrux.git
synced 2025-07-03 13:50:38 -04:00
updates
This commit is contained in:
parent
1f8cb3c145
commit
610604e80f
253 changed files with 27055 additions and 44 deletions
30
.config/ags/scripts/sway/executable_swayToRelativeWs.sh
Normal file
30
.config/ags/scripts/sway/executable_swayToRelativeWs.sh
Normal file
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Check if sway is running
|
||||
if ! pgrep -x sway > /dev/null; then
|
||||
echo "Sway is not running"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
# 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
|
Loading…
Add table
Add a link
Reference in a new issue