new "caffeine" script
This commit is contained in:
parent
1bd85672d4
commit
40c4a311c4
2 changed files with 32 additions and 0 deletions
15
river/.config/river/timeout.sh
Executable file
15
river/.config/river/timeout.sh
Executable 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
|
||||||
17
river/.config/river/toggle_caffeine.sh
Executable file
17
river/.config/river/toggle_caffeine.sh
Executable 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
|
||||||
Loading…
Reference in a new issue