From 9651ff906cc3ecf9262e31127075e8a77bb29937 Mon Sep 17 00:00:00 2001 From: aaron-gh Date: Wed, 30 Nov 2022 14:11:51 +0000 Subject: [PATCH] Added a script to check battery status --- scripts/battery_status.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 scripts/battery_status.sh diff --git a/scripts/battery_status.sh b/scripts/battery_status.sh new file mode 100644 index 0000000..a2993f0 --- /dev/null +++ b/scripts/battery_status.sh @@ -0,0 +1,10 @@ +#!/bin/env bash +#Get battery status +cd /sys/class/power_supply +for f in `ls`; do +if [ -e $f"/capacity" ]; then +export stat=`cat $f"/status"` +export cap=`cat $f"/capacity"` +echo battery $f": "$stat", "$cap"%" +fi +done|zenity --text-info --filename=/dev/stdin --title "Power Status" \ No newline at end of file