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

[i3blocks] Add brightness

This commit is contained in:
Przemyslaw Grondek 2019-05-28 14:01:09 +02:00
parent 1fdbfbd915
commit 889f0ef91c
2 changed files with 23 additions and 0 deletions

18
i3blocks/brightness Executable file
View File

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

View File

@ -3,6 +3,11 @@ command=~/.config/i3blocks/$BLOCK_NAME
separator_block_width=15
markup=none
[brightness]
label=🔆
interval=once
signal=10
[volume]
label=🔈
interval=once