aboutsummaryrefslogtreecommitdiffstats
path: root/config/hypr/scripts/LuaAutoReload.sh
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2026-07-10 11:21:24 -0700
committerPinapelz <yukais@pinapelz.com>2026-07-10 11:21:24 -0700
commit24de2a31a52d17b6f7214197bdbfeab7428742dd (patch)
treef7736c4712d5a394525a3da2f2b4294e81ba9540 /config/hypr/scripts/LuaAutoReload.sh
parent861bf5be200bfcf2440fec4cda911d29ec18493f (diff)
parentbca86bbec4757cec1f6f5bdea2ed210542f10fae (diff)
Merge remote-tracking branch 'upstream'
Diffstat (limited to 'config/hypr/scripts/LuaAutoReload.sh')
-rwxr-xr-xconfig/hypr/scripts/LuaAutoReload.sh17
1 files changed, 16 insertions, 1 deletions
diff --git a/config/hypr/scripts/LuaAutoReload.sh b/config/hypr/scripts/LuaAutoReload.sh
index 4a9d5040..128c1fc9 100755
--- a/config/hypr/scripts/LuaAutoReload.sh
+++ b/config/hypr/scripts/LuaAutoReload.sh
@@ -9,8 +9,23 @@
set -euo pipefail
-watch_root="$HOME/.config/hypr"
+watch_root="${XDG_CONFIG_HOME:-$HOME/.config}/hypr"
[ -d "$watch_root" ] || exit 0
+session="${HYPRLAND_INSTANCE_SIGNATURE:-default}"
+pid_file="/tmp/hypr-lua-autoreload-${session}.pid"
+
+if [ -f "$pid_file" ]; then
+ existing_pid="$(cat "$pid_file" 2>/dev/null || true)"
+ if [ -n "$existing_pid" ] && kill -0 "$existing_pid" 2>/dev/null; then
+ exit 0
+ fi
+fi
+
+echo "$$" >"$pid_file"
+cleanup() {
+ rm -f "$pid_file"
+}
+trap cleanup EXIT INT TERM
reload_hypr() {
hyprctl reload >/dev/null 2>&1 || true
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage