Ancestors

Toot

Written by Qper on 2024-03-26 at 17:28

QUESTION:

I have a script to show my battery status


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


But I have 2 batteries. and my scripting is far below par.. How can I edit this to show bot BAT0 and BAT1 as a result?

=> More informations about this toot | More toots from qper@infosec.exchange

Descendants

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/112163167231587839
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
237.094544 milliseconds
Gemini-to-HTML Time
0.86375 milliseconds

This content has been proxied by September (ba2dc).