|
@@ -1,14 +1,16 @@
|
|
|
#!/usr/bin/env bash
|
|
#!/usr/bin/env bash
|
|
|
# Three-state idle inhibitor for waybar (custom/inhibit):
|
|
# Three-state idle inhibitor for waybar (custom/inhibit):
|
|
|
# off -> normal: swayidle active, wluma adjusting brightness
|
|
# off -> normal: swayidle active, wluma adjusting brightness
|
|
|
-# idle -> idle inhibited (wlinhibit running)
|
|
|
|
|
|
|
+# idle -> idle inhibited (idlehold running)
|
|
|
# movie -> idle inhibited AND wluma stopped (brightness held steady)
|
|
# movie -> idle inhibited AND wluma stopped (brightness held steady)
|
|
|
# Usage: inhibit.sh [status|cycle]
|
|
# Usage: inhibit.sh [status|cycle]
|
|
|
|
|
|
|
|
SIGNAL=9
|
|
SIGNAL=9
|
|
|
|
|
+# idlehold: git.capella.pro/capella/idlehold (wlinhibit doesn't work on sway)
|
|
|
|
|
+IDLEHOLD="$HOME/.local/bin/idlehold"
|
|
|
|
|
|
|
|
has_wluma() { systemctl --user cat wluma.service >/dev/null 2>&1; }
|
|
has_wluma() { systemctl --user cat wluma.service >/dev/null 2>&1; }
|
|
|
-inhibiting() { pgrep -x -u "$USER" wlinhibit >/dev/null; }
|
|
|
|
|
|
|
+inhibiting() { pgrep -x -u "$USER" idlehold >/dev/null; }
|
|
|
wluma_on() { systemctl --user -q is-active wluma.service; }
|
|
wluma_on() { systemctl --user -q is-active wluma.service; }
|
|
|
|
|
|
|
|
state() {
|
|
state() {
|
|
@@ -21,8 +23,8 @@ state() {
|
|
|
fi
|
|
fi
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-inhibit_on() { inhibiting || setsid -f wlinhibit >/dev/null 2>&1; }
|
|
|
|
|
-inhibit_off() { pkill -x -u "$USER" wlinhibit; }
|
|
|
|
|
|
|
+inhibit_on() { inhibiting || setsid -f "$IDLEHOLD" >/dev/null 2>&1; }
|
|
|
|
|
+inhibit_off() { pkill -x -u "$USER" idlehold; }
|
|
|
|
|
|
|
|
case "${1:-status}" in
|
|
case "${1:-status}" in
|
|
|
cycle)
|
|
cycle)
|