summaryrefslogtreecommitdiff
path: root/scripts/toggle-idle
diff options
context:
space:
mode:
authorryukamish <[email protected]>2026-04-19 19:26:28 +0530
committerryukamish <[email protected]>2026-04-19 19:26:28 +0530
commit484dcc01c26d2567048d5d279dfce25399d7a6be (patch)
treec7ca94149934ef2354bf3ead8c64ade78b485497 /scripts/toggle-idle
parent457a1eb0b6d1e835d04388b6ecea718817df1f62 (diff)
add: path fix for niriwall and idling toggle for swayidle
Diffstat (limited to 'scripts/toggle-idle')
-rwxr-xr-xscripts/toggle-idle12
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/toggle-idle b/scripts/toggle-idle
new file mode 100755
index 0000000..c5334bf
--- /dev/null
+++ b/scripts/toggle-idle
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+chk_idle=$(pgrep swayidle)
+if [ -n "$chk_idle" ]; then
+ pkill swayidle && notify-send "SWAYIDLE" "Idling stopped"
+else
+ setsid -f swayidle -w \
+ timeout 600 'swaylock -f' \
+ timeout 630 'niri msg action power-off-monitors' \
+ resume 'niri msg action power-on-monitors' \
+ before-sleep 'swaylock -f' && \
+ notify-send "SWAYIDLE" "Idling started"
+fi