diff --git a/river/.config/river/timeout.sh b/river/.config/river/timeout.sh new file mode 100755 index 0000000..647af41 --- /dev/null +++ b/river/.config/river/timeout.sh @@ -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 diff --git a/river/.config/river/toggle_caffeine.sh b/river/.config/river/toggle_caffeine.sh new file mode 100755 index 0000000..e7fcb13 --- /dev/null +++ b/river/.config/river/toggle_caffeine.sh @@ -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