feat: differentiate between laptop and desktop
This commit is contained in:
parent
3a59d32f55
commit
5bb44594bb
50 changed files with 3432 additions and 1 deletions
17
eww_laptop/bar/scripts/battery
Executable file
17
eww_laptop/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
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue