diff options
Diffstat (limited to 'config/hypr/scripts/OverviewToggle.sh')
| -rwxr-xr-x | config/hypr/scripts/OverviewToggle.sh | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/config/hypr/scripts/OverviewToggle.sh b/config/hypr/scripts/OverviewToggle.sh index 21c2da34..8d4b285f 100755 --- a/config/hypr/scripts/OverviewToggle.sh +++ b/config/hypr/scripts/OverviewToggle.sh @@ -4,16 +4,18 @@ set -euo pipefail -# 1) Try Quickshell via Hyprland global dispatch (works if QS is running and listening) -if hyprctl dispatch global quickshell:overviewToggle >/dev/null 2>&1; then - exit 0 +# 1) Try Quickshell via IPC (works if QS is running and listening) +if pgrep -x quickshell >/dev/null 2>&1; then + if qs ipc -c overview call overview toggle >/dev/null 2>&1; then + exit 0 + fi fi -# If QS isn't running, try starting it and retry once +# If QS isn't running, but the CLI exists, try starting it and retry once if command -v qs >/dev/null 2>&1; then - qs >/dev/null 2>&1 & + qs -c overview >/dev/null 2>&1 & sleep 0.6 - if hyprctl dispatch global quickshell:overviewToggle >/dev/null 2>&1; then + if qs ipc -c overview call overview toggle >/dev/null 2>&1; then exit 0 fi fi |
