Skip to content

Commit

Permalink
Allow "Unlimited" amount of minutes for inhibit-idle script (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrius authored May 22, 2024
1 parent f133fce commit 3524059
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions community/sway/usr/bin/inhibit-idle
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,21 @@ inhibit() {

case $1'' in
'interactive')
MINUTES=$(echo -e "1\n10\n15\n20\n30\n45\n60\n90\n120" | rofi -dmenu -p "Select how many minutes to inhibit idle:")
inhibit $((MINUTES * 60))
MINUTES=$(echo -e "1\n10\n15\n20\n30\n45\n60\n90\n120\nUnlimited" | rofi -dmenu -p "Select how many minutes to inhibit idle:")
if [ "$MINUTES" = "Unlimited" ]; then
SECONDS=$((365 * 24 * 60 * 60))
else
SECONDS=$((MINUTES * 60))
fi
inhibit $SECONDS
;;
'off')
pkill -f "systemd-inhibit --what=idle" || true
waybar-signal idle
;;
esac

#Returns data for Waybar
# Returns data for Waybar
if status; then
class="on"
text="Inhibiting idle (Mid click to clear)"
Expand Down

0 comments on commit 3524059

Please sign in to comment.