sisyphus/scripts/wlsunset.sh

16 lines
466 B
Bash
Raw Normal View History

2022-04-22 15:33:04 +02:00
#!/usr/bin/env bash
# Script to disable for an hour or immediately continue wlsunset. 'Toggle'
# Check if wlsunset is still running
pid=$(pgrep wlsunset)
if [[ -z ${pid} ]] ; then
# Start wlsunset right away.
wlsunset -l 50 -L 4 -t 2500 &
else
# Currently stop wlsunset but restart in an hour.
kill ${pid}
2022-06-02 11:44:58 +02:00
~/.scripts/notify.sh 'Stopping sunset' 'Restarting in an hour'
2022-04-22 15:33:04 +02:00
at now +1 hours -f ~/.scripts/wlsunset.sh
fi