-
Notifications
You must be signed in to change notification settings - Fork 0
/
shifter
executable file
·68 lines (53 loc) · 1.29 KB
/
shifter
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
#color temperature/brightness adjustment scripts (saves to file)
#Go to the directory where the scripts are held.
# NEWER VERSIONS USE redshift -PO {num}
cd ~/.local/bin/utilities || exit
#Check if RV exists, if it doesn't make it and give it X value.
[[ -f RV ]] || echo 6500 > RV
#Setting the local variable to file RV's value.
num=$(<RV)
num2=$(<BV)
colder(){
#Check if the number is under an arbitrary limit, and if so increment by X.
if (( $num <= 6500 ))
then
echo "$((num+=250))" > RV
redshift -O ${num}
cat RV
dunstify -r 454 -u low "Colour Temperature : $(<RV)"
fi
}
warmer(){
#Check if the number is under an arbitrary limit, and if so increment by X.
if (( $num >= 1500 ))
then
echo "$((num-=250))" > RV
redshift -O ${num}
cat RV
dunstify -r 454 -u low "Colour Temperature : $(<RV)"
fi
}
brighter(){
if ! [ -f BV ]
then echo 100 > BV
fi
if (( $num2 < 100 ))
then echo "$((num2+=25))" > BV
sudo ddcutil setvcp --bus 1 10 $num2
sudo ddcutil setvcp --bus 2 10 $num2
dunstify -r 454 -u low "Main Monitor Brightness : $(<BV)"
fi
}
darker(){
if ! [ -f BV ]
then echo 100 > BV
fi
if (( $num2 > 0 ))
then echo "$((num2-=25))" > BV
sudo ddcutil setvcp --bus 1 10 $num2
sudo ddcutil setvcp --bus 2 10 $num2
dunstify -r 454 -u low "Main Monitor Brightness : $(<BV)"
fi
}
"$@"