You can type, e.g. redshift -O 4000, in terminal to set temperature to 4000 exactly but sometimes you want to adjust the colour slightly in either direction once it has been set at a value
Asked
Active
Viewed 1,018 times
1 Answers
1
I had the same question last night, and since no one has answered this, here is a script I wrote. I haven't written a shell script for years, and this is my first ever post, so may need improvement. If you set the plus/increment script as start up, and stop redshift auto starting, this will allow you to attach the below scripts to a hot key.
#!/bin/bash
#Increase temperature
maxNum=2700
incNum=135
FILE="redshift_settings"
FILELOCATION="$(dirname "$(realpath "$0")")/$FILE"
if [ ! -f "$FILELOCATION" ]; then
echo "File does not exist, creating"
touch "$FILELOCATION"
echo "$maxNum" > "$FILELOCATION"
fi
rsTemp=$(head -n 1 $FILELOCATION)
if [[ $rsTemp -lt $maxNum ]]; then
let "rsTemp += incNum";
redshift -O $rsTemp
echo "$rsTemp" > "$FILELOCATION"
fi
exit 0
#!/bin/bash
#Decrease temperature
maxNum=2700
decNum=135;
FILE="redshift_settings"
FILELOCATION="$(dirname "$(realpath "$0")")/$FILE"
if [ ! -f "$FILELOCATION" ]; then
echo "File does not exist, creating"
touch "$FILELOCATION"
echo "$maxNum" > "$FILELOCATION"
fi
rsTemp=$(head -n 1 $FILELOCATION)
if [[ $rsTemp -gt 1000 ]]; then
let "rsTemp -= decNum";
redshift -O $rsTemp
echo "$rsTemp" > "$FILELOCATION"
fi
exit 0

Zanna
- 70,465

Quentin Andrews
- 11
- 2
-P
to prevent red filter from stacking on top of eachother. So the command becomes:redshift -P -O $rsTemp
– n0tis Feb 07 '23 at 22:17