JirR02 af9d88c05f Dotfiles V.1.1.5
Updated Neovim Plugins as well as cleaned up aerospace config and
sketbar config and added fastfetch config
2025-06-11 22:16:38 +02:00

40 lines
761 B
Bash
Executable File

#!/bin/bash
PERCENTAGE="$(pmset -g batt | grep -Eo "\d+%" | cut -d% -f1)"
CHARGING="$(pmset -g batt | grep 'AC Power')"
if [ "$PERCENTAGE" = "" ]; then
exit 0
fi
case "${PERCENTAGE}" in
9[0-9]|100)
ICON=""
COLOR="0xFFA6DA95"
;;
[6-8][0-9])
ICON=""
COLOR="0xFFEED49F"
;;
[3-5][0-9])
ICON=""
COLOR="0xFFF5A97F"
;;
[1-2][0-9])
ICON=""
COLOR="0xFFED8796"
;;
*)
ICON=""
COLOR="0xFFED8796"
esac
if [[ "$CHARGING" != "" ]]; then
ICON=""
COLOR="0xFFA6DA95"
fi
# The item invoking this script (name $NAME) will get its icon and label
# updated with the current battery status
sketchybar --set "$NAME" icon.color="$COLOR" icon="$ICON" label.color="$COLOR" label="${PERCENTAGE}%"