Files
dotfiles/i3blocks/brightness.sh
Antoine Phan 0cd53e0b65 Moving files:
2024-07-27 00:06:16 +07:00

30 lines
448 B
Bash

#!/bin/bash
current=$(brightnessctl g)
max=$(brightnessctl m)
percentage=$(printf "%3s" $((100 * current / max)))
if [[ $percentage -eq 100 ]]
then
ICON="🎑"
elif (( $percentage >= 75 ))
then
ICON="🌕"
elif (( $percentage >= 50 ))
then
ICON="🌖"
elif (( $percentage >= 25 ))
then
ICON="🌗"
elif (( $percentage >= 10 ))
then
ICON="🌘"
elif (( $percentage >= 0 ))
then
ICON="🌑"
else
ICON="🌚"
fi
echo "$ICON $percentage% "