aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rw-r--r--bin/.install.yml22
-rwxr-xr-xbin/exit-menu-sway.sh (renamed from bin/exit-menu.sh)0
-rwxr-xr-xbin/get-inhibit-idle-status.sh17
-rwxr-xr-xbin/inhibit-idle.sh14
4 files changed, 31 insertions, 22 deletions
diff --git a/bin/.install.yml b/bin/.install.yml
deleted file mode 100644
index e71e0ea..0000000
--- a/bin/.install.yml
+++ /dev/null
@@ -1,22 +0,0 @@
-name: Copy scripts
-steps:
- - !Link
- from: "battery-notify.sh"
- to: "~/bin/battery-notify.sh"
- recursive: false
- - !Link
- from: "exit-menu.sh"
- to: "~/bin/exit-menu.sh"
- recursive: false
- - !Link
- from: "hyprctl-zoom-daemon.sh"
- to: "~/bin/hyprctl-zoom-daemon.sh"
- recursive: false
- - !Link
- from: "hyprctl-zoom.sh"
- to: "~/bin/hyprctl-zoom.sh"
- recursive: false
- - !Link
- from: "swayidle.sh"
- to: "~/bin/swayidle.sh"
- recursive: false
diff --git a/bin/exit-menu.sh b/bin/exit-menu-sway.sh
index 9c9f7ab..9c9f7ab 100755
--- a/bin/exit-menu.sh
+++ b/bin/exit-menu-sway.sh
diff --git a/bin/get-inhibit-idle-status.sh b/bin/get-inhibit-idle-status.sh
new file mode 100755
index 0000000..9c74c4e
--- /dev/null
+++ b/bin/get-inhibit-idle-status.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+set -uo pipefail
+
+changescript="$(pidof "inhibit-idle.sh" || true)"
+if [ -n "$changescript" ]; then
+ wait "$changescript"
+fi
+
+idleprog="hypridle"
+
+isactive="$(systemctl --user is-active $idleprog)"
+if [ "$isactive" = "active" ]; then
+ echo "{\"text\": \"running\", \"alt\": \"running\", \"tooltip\": \"$idleprog is running\", \"class\": \"running\" }"
+else
+ echo "{\"text\": \"suspended\", \"alt\": \"suspended\", \"tooltip\": \"$idleprog is suspended\", \"class\": \"suspended\" }"
+fi
+
diff --git a/bin/inhibit-idle.sh b/bin/inhibit-idle.sh
new file mode 100755
index 0000000..c52ff41
--- /dev/null
+++ b/bin/inhibit-idle.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+set -uo pipefail
+
+idleprog="hypridle"
+
+isactive="$(systemctl --user is-active $idleprog)"
+if [ "$isactive" = "active" ]; then
+ systemctl --user stop $idleprog
+ notify-send "Idle Inhibitor" "$idleprog suspended (systemd)"
+else
+ systemctl --user start $idleprog
+ notify-send "Idle Inhibitor" "$idleprog resumed (systemd)"
+fi
+