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

[i3] Fix brightness block

This commit is contained in:
Przemysław Grondek 2019-11-07 10:41:13 +01:00
parent cf27918714
commit f6aedd07d5

View File

@ -1,14 +1,23 @@
#!/usr/bin/env bash
output=eDP-1
brightness=$(xrandr --verbose | grep Brightness | awk '{printf "%d", $2*100}')
brightness=?
echo $brightness
get_brighntess() {
brightness=$(xrandr --verbose | grep Brightness | awk '{printf "%d", $2*100}')
}
print_bringtness() {
get_brighntess
echo $brightness
}
set_brightness() {
xrandr --output $output --brightness $(echo $1 | awk '{printf "%0.2f", $1/100}' )
}
get_brighntess
case $BLOCK_BUTTON in
4) set_brightness $((brightness + 10 ))
;; # scroll up
@ -16,3 +25,5 @@ case $BLOCK_BUTTON in
5) set_brightness $((brightness - 10 ))
;; # scroll down
esac
print_bringtness