Added screen brightness to dwmblocks

This commit is contained in:
Clay Gomera 2022-07-19 22:46:41 -04:00
parent 6437278329
commit 88e708fa55
2 changed files with 13 additions and 0 deletions

View file

@ -7,6 +7,8 @@ static const Block blocks[] = {
{"", "$HOME/.config/suckless/dwmblocks/scripts/battery", 1, 1}, {"", "$HOME/.config/suckless/dwmblocks/scripts/battery", 1, 1},
{"", "$HOME/.config/suckless/dwmblocks/scripts/brightness", 1, 1},
{"", "$HOME/.config/suckless/dwmblocks/scripts/volume", 1, 1}, {"", "$HOME/.config/suckless/dwmblocks/scripts/volume", 1, 1},
{"", "$HOME/.config/suckless/dwmblocks/scripts/clock", 5, 0}, {"", "$HOME/.config/suckless/dwmblocks/scripts/clock", 5, 0},

View file

@ -0,0 +1,11 @@
#!/usr/bin/env bash
brt=$(xbacklight -get)
if [ "$brt" = "100.000000" ]; then
icon=🔆
elif [ "$brt" \> "50%.*" ]; then
icon=🔆
elif [ "$brt" \< "49%.*" ]; then
icon=🔅
fi
echo " $icon ${brt%.*}% "