mirror of
https://github.com/Ahwxorg/nixos-config.git
synced 2026-03-19 15:50:30 +01:00
feat: adds sketchybar configuration
This commit is contained in:
parent
d8cdb130b5
commit
4b0e72ec7a
9 changed files with 226 additions and 0 deletions
15
modules/home/sketchybar/plugins/battery.sh
Executable file
15
modules/home/sketchybar/plugins/battery.sh
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash
|
||||
|
||||
PERCENTAGE="$(pmset -g batt | grep -Eo "...%" | awk '{print $1}')"
|
||||
CHARGING="$(pmset -g batt | grep 'AC Power')"
|
||||
|
||||
# The item invoking this script (name $NAME) will get its icon and label
|
||||
# updated with the current battery status
|
||||
|
||||
if [[ "$CHARGING" != "" ]]; then
|
||||
STATE="CHAR:"
|
||||
else
|
||||
STATE="BATT:"
|
||||
fi
|
||||
|
||||
sketchybar --set "$NAME" label="$STATE $PERCENTAGE"
|
||||
Loading…
Add table
Add a link
Reference in a new issue