mirror of
https://github.com/mr0xb/dotfiles.git
synced 2026-08-27 19:34:57 -04:00
updates
This commit is contained in:
parent
bc4d4c403a
commit
715eb53860
57 changed files with 7755 additions and 3 deletions
26
.config/sketchybar/plugins/battery.sh
Executable file
26
.config/sketchybar/plugins/battery.sh
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
#!/bin/sh
|
||||
|
||||
source "$CONFIG_DIR/colors.sh"
|
||||
|
||||
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="0xffa8ff60" ;;
|
||||
[6-8][0-9]) ICON=" " ; COLOR="0xffa8ff60" ;;
|
||||
[3-5][0-9]) ICON=" " ; COLOR="0xfffffeb7" ;;
|
||||
[1-2][0-9]) ICON=" " ; COLOR="0xfffcb6b0" ;;
|
||||
*) ICON=" " ; COLOR="0xfffa6c60" ;;
|
||||
esac
|
||||
|
||||
if [ "$CHARGING" != "" ]; then
|
||||
ICON=" "
|
||||
#COLOR="0xffa8ff60"
|
||||
COLOR=$GREEN
|
||||
fi
|
||||
|
||||
sketchybar --set "$NAME" icon="$ICON" icon.color="$COLOR" label="${PERCENTAGE}%" label.drawing=on
|
||||
Loading…
Reference in a new issue