add thinkpad x220 support

This commit is contained in:
randomuser 2022-07-08 02:28:49 +00:00
parent 7f098bede3
commit 12f5bac3b9
1 changed files with 2 additions and 0 deletions

View File

@ -2,6 +2,7 @@
power_prefix="/sys/class/power_supply/"
[ -d "${power_prefix}sbs-20-000b" ] && bat="sbs-20-000b"
[ -d "${power_prefix}BAT0" ] && bat="BAT0"
[ "$(ps aux | grep pulseaudio | wc -l)" -eq 2 ] && ss="pulse" || ss="alsa"
@ -25,6 +26,7 @@ mod_bspwm () {
}
mod_power () {
[ -z "$bat" ] ||
tr -d '\n' < /sys/class/power_supply/$bat/capacity
}