Browse Source

Make the brightness a little bit prettier

master
Riyyi 7 years ago
parent
commit
d3f5ce6d92
  1. 1
      .config/i3/blocks
  2. 12
      .config/i3/scripts/brightness.sh

1
.config/i3/blocks

@ -43,7 +43,6 @@ interval=1
signal=10 signal=10
[brightness] [brightness]
label=
command=$HOME/.config/i3/scripts/brightness.sh command=$HOME/.config/i3/scripts/brightness.sh
interval=1 interval=1

12
.config/i3/scripts/brightness.sh

@ -11,4 +11,14 @@ case $BLOCK_BUTTON in
5) xbacklight -dec 10 ;; 5) xbacklight -dec 10 ;;
esac esac
printf "%.0f" "$(xbacklight -get)" percentage=$(printf "%.0f" "$(xbacklight)")
if (( $percentage >= 75 )); then
icon=""
elif (( $percentage >= 25 )); then
icon=""
else
icon=""
fi
echo $icon $percentage%

Loading…
Cancel
Save