mirror of
https://github.com/fscotto/infra.git
synced 2026-07-30 00:30:00 +00:00
Add Hyprland Void desktop profile
This commit is contained in:
34
dotfiles/desktop/.config/hypr/scripts/workspace-cycle
Executable file
34
dotfiles/desktop/.config/hypr/scripts/workspace-cycle
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/bin/sh
|
||||
# Cycle Hyprland workspaces within the fixed 1..10 desktop set.
|
||||
|
||||
set -eu
|
||||
|
||||
direction="${1:-next}"
|
||||
current="$(hyprctl activeworkspace -j | jq -r '.id')"
|
||||
|
||||
case "$current" in
|
||||
''|*[!0-9-]*) current=1 ;;
|
||||
esac
|
||||
|
||||
case "$direction" in
|
||||
next)
|
||||
if [ "$current" -ge 10 ] || [ "$current" -lt 1 ]; then
|
||||
target=1
|
||||
else
|
||||
target=$((current + 1))
|
||||
fi
|
||||
;;
|
||||
prev)
|
||||
if [ "$current" -le 1 ] || [ "$current" -gt 10 ]; then
|
||||
target=10
|
||||
else
|
||||
target=$((current - 1))
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
printf 'Usage: %s {next|prev}\n' "$0" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exec hyprctl dispatch workspace "$target"
|
||||
Reference in New Issue
Block a user