aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/scripts/OverviewToggle.sh
diff options
context:
space:
mode:
authorMartin Guzman <55927935+brockar@users.noreply.github.com>2025-11-22 13:42:39 -0300
committerGitHub <noreply@github.com>2025-11-22 13:42:39 -0300
commitbcfd5e7c2b67f0a62b1ceeb62d20b0a80ca55a70 (patch)
treee87f649fe0c9d8f382b8f465d1468b6495fb5886 /config/hypr/scripts/OverviewToggle.sh
parentc862835221decf03b6640bb43e4044861cceaa04 (diff)
parent1351220a092414ae593bc006e3a3ebc09523198d (diff)
Merge pull request #871 from JaKooLit/development
[Bug] Change to waybar sleep timers was too long, slowed down waybar start/refressh
Diffstat (limited to 'config/hypr/scripts/OverviewToggle.sh')
-rwxr-xr-xconfig/hypr/scripts/OverviewToggle.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/config/hypr/scripts/OverviewToggle.sh b/config/hypr/scripts/OverviewToggle.sh
new file mode 100755
index 00000000..2737234c
--- /dev/null
+++ b/config/hypr/scripts/OverviewToggle.sh
@@ -0,0 +1,41 @@
+#!/usr/bin/env bash
+# /* ---- 💫 https://github.com/JaKooLit 💫 ---- */ #
+# Overview toggle wrapper - tries Quickshell first, falls back to AGS
+
+set -euo pipefail
+
+# 1) Try Quickshell via Hyprland global dispatch (works if QS is running and listening)
+# Only attempt this if a Quickshell process is running; otherwise Hyprland will
+# still return success for the dispatch and we'll never fall back to AGS.
+if pgrep -x quickshell >/dev/null 2>&1; then
+ if hyprctl dispatch global quickshell:overviewToggle >/dev/null 2>&1; then
+ exit 0
+ fi
+fi
+
+# 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 &
+ sleep 0.6
+ if hyprctl dispatch global quickshell:overviewToggle >/dev/null 2>&1; then
+ exit 0
+ fi
+fi
+
+# 2) Fall back to AGS template
+if command -v ags >/dev/null 2>&1; then
+ pkill rofi || true
+ if ags -t 'overview' >/dev/null 2>&1; then
+ exit 0
+ fi
+ # If it failed, try starting AGS daemon then call the template
+ ags >/dev/null 2>&1 &
+ sleep 0.6
+ if ags -t 'overview' >/dev/null 2>&1; then
+ exit 0
+ fi
+fi
+
+# If we get here, neither worked
+notify-send "Overview" "Neither Quickshell nor AGS is available" -u low 2>/dev/null || true
+exit 1
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage