diff options
| author | Leonardo Bishop <me@leonardobishop.com> | 2024-12-25 14:55:37 +0000 |
|---|---|---|
| committer | Leonardo Bishop <me@leonardobishop.com> | 2024-12-25 14:55:37 +0000 |
| commit | 59fd10c296ee5fda22226ffd71707ca597f85ed7 (patch) | |
| tree | 7c1f2457706783674f437975973840eb0f34b741 /bin/get-inhibit-idle-status.sh | |
| parent | f2866e8ad4a9ba0b12ea047b2f72f7d7d457d63f (diff) | |
Add bin
Diffstat (limited to 'bin/get-inhibit-idle-status.sh')
| -rwxr-xr-x | bin/get-inhibit-idle-status.sh | 17 |
1 files changed, 17 insertions, 0 deletions
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 + |
