new "caffeine" script

This commit is contained in:
William Ball 2025-02-06 20:52:14 -08:00
parent 1bd85672d4
commit 40c4a311c4
Signed by: wball
GPG key ID: B8682D8137B70765
2 changed files with 32 additions and 0 deletions

15
river/.config/river/timeout.sh Executable file
View file

@ -0,0 +1,15 @@
#!/bin/sh
caffeine_file=$HOME/.cache/idle
if [[ ! -f $caffeine_file ]] then
echo 0 > $caffeine_file
fi
caffeine=$(<$HOME/.cache/idle)
if [[ $caffeine -eq 0 ]] then
swaylock -f -c 000000
else
notify-send 'Caffeine' 'Not sleeping'
fi

View file

@ -0,0 +1,17 @@
#!/bin/sh
caffeine_file=$HOME/.cache/idle
if [[ ! -f $caffeine_file ]] then
echo 0 > $caffeine_file
fi
caffeine=$(<$HOME/.cache/idle)
if [[ $caffeine -eq 0 ]] then
echo 1 > $caffeine_file
notify-send 'Caffeine' 'Caffeine Enabled'
else
echo 0 > $caffeine_file
notify-send 'Caffeine' 'Caffeine Disabled'
fi