diff options
author | Camil Staps | 2023-02-20 16:38:30 +0100 |
---|---|---|
committer | Camil Staps | 2023-02-20 16:38:30 +0100 |
commit | da08e8288c455f94ddc41d299a656e8019edde87 (patch) | |
tree | f50d75bd703146c9bedeaa2b9fa919d330d07840 /yoga/bin | |
parent | Add night light shortcuts (diff) |
Add shortcuts to set night mode to day/night (extremes); change shortcuts for this and brightness
Diffstat (limited to 'yoga/bin')
-rwxr-xr-x | yoga/bin/night-light | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/yoga/bin/night-light b/yoga/bin/night-light index 6c4224c..b76054d 100755 --- a/yoga/bin/night-light +++ b/yoga/bin/night-light @@ -1,5 +1,5 @@ #!/bin/bash -# Usage: night-light [increase|decrease] +# Usage: night-light [increase|decrease|day|night] set -e TMPFILE=/tmp/.night-light-index @@ -20,18 +20,16 @@ STEPS=( "1:1:1" ) -CUR=${#STEPS[@]} +CUR=$((${#STEPS[@]}-1)) if [ -f $TMPFILE ]; then CUR=$(cat $TMPFILE) fi case "$1" in - increase) - NEW=$(($CUR >= ${#STEPS[@]} ? $CUR : $CUR+1)) - ;; - decrease) - NEW=$(($CUR <= 0 ? $CUR : $CUR-1)) - ;; + increase) NEW=$(($CUR >= ${#STEPS[@]} ? $CUR : $CUR+1)) ;; + decrease) NEW=$(($CUR <= 0 ? $CUR : $CUR-1)) ;; + day) NEW=$((${#STEPS[@]}-1)) ;; + night) NEW=0 ;; *) echo "Invalid argument '$1'" exit 1 |