Adding lots of cool stuff to dotfiles
This commit is contained in:
29
.config/i3blocks/brightness.sh
Normal file
29
.config/i3blocks/brightness.sh
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/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% "
|
||||
Reference in New Issue
Block a user