From 59fd10c296ee5fda22226ffd71707ca597f85ed7 Mon Sep 17 00:00:00 2001 From: Leonardo Bishop Date: Wed, 25 Dec 2024 14:55:37 +0000 Subject: Add bin --- bin/get-inhibit-idle-status.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 bin/get-inhibit-idle-status.sh (limited to 'bin/get-inhibit-idle-status.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 + -- cgit v1.2.3-70-g09d2