1
0
mirror of https://github.com/pgrondek/config.git synced 2024-11-22 03:53:43 +00:00

[i3blocks] Limit brightness to (0,100)%

This commit is contained in:
Przemysław Grondek 2020-02-13 13:18:32 +01:00
parent 987a59167c
commit 0e968b9cb1

View File

@ -8,8 +8,14 @@ get_brighntess() {
} }
set_brightness() { set_brightness() {
xrandr --output $output --brightness $(echo $1 | awk '{printf "%0.2f", $1/100}' )
brightness=$1 brightness=$1
if [ "$brightness" -gt 100 ]; then
brightness=100
fi
if [ "$brightness" -lt 0 ]; then
brightness=0
fi
xrandr --output $output --brightness $(echo $brightness | awk '{printf "%0.2f", $1/100}' )
} }
get_brighntess get_brighntess