1
0
Fork 0
mirror of https://github.com/SinTan1729/random.git synced 2024-12-26 13:18:35 -06:00

Changed command line option

This commit is contained in:
Sayantan Santra 2022-07-11 21:19:33 -05:00
parent a9f46d468d
commit d364655447

View file

@ -26,15 +26,15 @@ else
exit exit
fi fi
# Check if called by crontab as routine. If yes, create a schedule using `at`, # Check if we want to access the scheduler. If yes, create a schedule using `at`,
# otherwise adjust brightness immediately # otherwise adjust brightness immediately
if [ "$1" == "crontab" ]; then if [ "$1" == "scheduler" ]; then
if [ $(sunwait poll $latitude $longitude) == "DAY" ]; then if [ $(sunwait poll $latitude $longitude) == "DAY" ]; then
# +1 minute is so that the next schedule is set up properly (or sunwait reports day/night in a misleading way) # +1 minute is so that the next schedule is set up properly (or sunwait reports day/night in a misleading way)
at -m $(sunwait report 35.221050N 97.445938W | grep "Daylight:" | awk '{print $6}') +1 minute <<< "ddcutil setvcp 10 40 && $scriptdir/brightness-by-daylight.sh crontab" at -m $(sunwait report 35.221050N 97.445938W | grep "Daylight:" | awk '{print $6}') +1 minute <<< "ddcutil setvcp 10 40 && $scriptdir/brightness-by-daylight.sh scheduler"
else else
at -m $(sunwait report 35.221050N 97.445938W | grep "Daylight:" | awk '{print $4}') +1 minute <<< "ddcutil setvcp 10 70 && $scriptdir/brightness-by-daylight.sh crontab" at -m $(sunwait report 35.221050N 97.445938W | grep "Daylight:" | awk '{print $4}') +1 minute <<< "ddcutil setvcp 10 70 && $scriptdir/brightness-by-daylight.sh scheduler"
fi fi
else else
if [ $(sunwait poll $latitude $longitude) == "DAY" ]; then if [ $(sunwait poll $latitude $longitude) == "DAY" ]; then