Rearrange for tidier structure (#2212)

This commit is contained in:
clsty
2025-10-16 07:19:55 +08:00
parent 13065d7e5a
commit 8b493e091d
529 changed files with 165 additions and 138 deletions
+18
View File
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
curr_workspace="$(hyprctl activeworkspace -j | jq -r ".id")"
dispatcher="$1"
shift ## The target is now in $1, not $2
if [[ -z "${dispatcher}" || "${dispatcher}" == "--help" || "${dispatcher}" == "-h" || -z "$1" ]]; then
echo "Usage: $0 <dispatcher> <target>"
exit 1
fi
if [[ "$1" == *"+"* || "$1" == *"-"* ]]; then ## Is this something like r+1 or -1?
hyprctl dispatch "${dispatcher}" "$1" ## $1 = workspace id since we shifted earlier.
elif [[ "$1" =~ ^[0-9]+$ ]]; then ## Is this just a number?
target_workspace=$(((($curr_workspace - 1) / 10 ) * 10 + $1))
hyprctl dispatch "${dispatcher}" "${target_workspace}"
else
hyprctl dispatch "${dispatcher}" "$1" ## In case the target in a string, required for special workspaces.
exit 1
fi