diff --git a/user/.config/suckless/dwmblocks/blocks.def.h b/user/.config/suckless/dwmblocks/blocks.def.h index 1f76b7427..7b9590b9f 100644 --- a/user/.config/suckless/dwmblocks/blocks.def.h +++ b/user/.config/suckless/dwmblocks/blocks.def.h @@ -7,6 +7,8 @@ static const Block blocks[] = { {"", "$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/clock", 5, 0}, diff --git a/user/.config/suckless/dwmblocks/scripts/brightness b/user/.config/suckless/dwmblocks/scripts/brightness new file mode 100755 index 000000000..fbf6de18b --- /dev/null +++ b/user/.config/suckless/dwmblocks/scripts/brightness @@ -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%.*}% "