mirror of
https://gitlab.com/dwt1/dotfiles.git
synced 2026-04-23 03:20:26 +10:00
Playing with eww
This commit is contained in:
17
.config/eww/bar/scripts/battery
Executable file
17
.config/eww/bar/scripts/battery
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
battery() {
|
||||
BAT=`ls /sys/class/power_supply | grep BAT | head -n 1`
|
||||
cat /sys/class/power_supply/${BAT}/capacity
|
||||
}
|
||||
battery_stat() {
|
||||
BAT=`ls /sys/class/power_supply | grep BAT | head -n 1`
|
||||
cat /sys/class/power_supply/${BAT}/status
|
||||
}
|
||||
|
||||
if [[ "$1" == "--bat" ]]; then
|
||||
battery
|
||||
elif [[ "$1" == "--bat-st" ]]; then
|
||||
battery_stat
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user