useful_scripts/set_brightness.sh

24 lines
834 B
Bash
Raw Normal View History

2024-03-02 13:22:30 +00:00
#!/bin/bash
H=$(date +%k)
if (( $H >= 0 && $H <= 7 )); then
/usr/bin/xrandr --output eDP --brightness .2
sudo /usr/bin/brightnessctl --device='asus::kbd_backlight' set 3
elif (( $H > 7 && $H <= 10 )); then
/usr/bin/xrandr --output eDP --brightness .5
sudo /usr/bin/brightnessctl --device='asus::kbd_backlight' set 1
2024-03-02 14:56:52 +00:00
elif (( $H > 10 && $H < 17 )); then
2024-03-02 13:22:30 +00:00
/usr/bin/xrandr --output eDP --brightness .7
sudo /usr/bin/brightnessctl --device='asus::kbd_backlight' set 0
2024-03-02 14:56:52 +00:00
elif (( $H >= 17 && $H <= 22 )); then
2024-03-02 13:22:30 +00:00
/usr/bin/xrandr --output eDP --brightness .5
sudo /usr/bin/brightnessctl --device='asus::kbd_backlight' set 1
elif (( $H > 22 && $H <= 23 )); then
/usr/bin/xrandr --output eDP --brightness .3
sudo /usr/bin/brightnessctl --device='asus::kbd_backlight' set 2
else
echo "Error"
fi