Add idle-inhibit
Sometimes I don't want the computer to go to sleep bacause I'm running something in the background. for that I always used systemd-inhibit sleep 999999 manually on the terminal, but I want it to be easy to use without remembering the whole command every time. Therefor I added a custom button to waybar which does that for me.
This commit is contained in:
parent
bc0d3a7737
commit
de7375bfb7
3 changed files with 25 additions and 1 deletions
13
hypr/scripts/idle-inhibit-toggle.sh
Executable file
13
hypr/scripts/idle-inhibit-toggle.sh
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
PIDFILE="$XDG_RUNTIME_DIR/idle-inhibit.pid"
|
||||
|
||||
if [[ -f "$PIDFILE" ]] && kill -0 "$(cat "$PIDFILE")" 2>/dev/null; then
|
||||
kill "$(cat "$PIDFILE")"
|
||||
rm -f "$PIDFILE"
|
||||
echo "off"
|
||||
else
|
||||
systemd-inhibit --what=idle:sleep --why="Manual Waybar inhibit" sleep infinity &
|
||||
echo $! > "$PIDFILE"
|
||||
echo "on"
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue