mirror of
https://github.com/js0ny/dotfiles.git
synced 2025-12-21 08:43:00 +00:00
chezmoi: macOS
This commit is contained in:
parent
fff9275372
commit
c1a63e4658
39 changed files with 10 additions and 284 deletions
30
home/dot_config/sketchybar/plugins/executable_power.sh
Normal file
30
home/dot_config/sketchybar/plugins/executable_power.sh
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env 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=""
|
||||
;;
|
||||
[6-8][0-9])
|
||||
ICON=""
|
||||
;;
|
||||
[3-5][0-9])
|
||||
ICON=""
|
||||
;;
|
||||
[1-2][0-9])
|
||||
ICON=""
|
||||
;;
|
||||
*) ICON="" ;;
|
||||
esac
|
||||
|
||||
if [ "$CHARGING" != "" ]; then
|
||||
ICON=""
|
||||
fi
|
||||
|
||||
sketchybar --set "$NAME" icon="$ICON" label="${PERCENTAGE}% "
|
||||
Loading…
Add table
Add a link
Reference in a new issue