u
This commit is contained in:
@@ -74,13 +74,30 @@ rshift() {
|
||||
cmd=$1
|
||||
fi
|
||||
|
||||
temperature_file="/tmp/temperature.txt"
|
||||
|
||||
if [ ${cmd} == "info" ] ; then
|
||||
echo "{morning, day, evening, night, bedtime}"
|
||||
elif [ ${cmd} == "show" ] ||
|
||||
[ ${cmd} == "display" ]
|
||||
; then
|
||||
if [ -f "${temperature_file}" ] ; then
|
||||
temperature=$(cat /tmp/temperature.txt)
|
||||
else
|
||||
temperature=n/a
|
||||
fi
|
||||
echo "${temperature}K"
|
||||
elif
|
||||
[ ${cmd} == "disable" ] ||
|
||||
[ ${cmd} == "off" ]
|
||||
; then
|
||||
redshift -x
|
||||
elif [ ${cmd} == "morning" ] ; then
|
||||
temperature=4500
|
||||
elif
|
||||
[ ${cmd} == "day" ] ||
|
||||
[ ${cmd} == "normal" ] || [ ${cmd} == "default" ] || [ ${cmd} == "off" ] ; then
|
||||
[ ${cmd} == "normal" ] ||
|
||||
; then
|
||||
temperature=6500
|
||||
elif [ ${cmd} == "evening" ] ; then
|
||||
temperature=3500
|
||||
@@ -93,6 +110,7 @@ rshift() {
|
||||
fi
|
||||
|
||||
echo "setting temperature to ${temperature}K"
|
||||
touch '${temperature}' > ${temperature_file}
|
||||
redshift -P -O ${temperature}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user