Base scripts for Artix and startx config.
This commit is contained in:
1 parent
9d2999d5c0
commit
459bfff2ca
8 files changed
+218
No files matched your search
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
for battery in /sys/class/power_supply/BAT?*; do
|
||||
status=""
|
||||
case "$(cat "$battery/status" 2>&1)" in
|
||||
"Full") status="=" ;;
|
||||
"Charging") status="+" ;;
|
||||
"Discharging") status="-" ;;
|
||||
"Not charging") status="/" ;;
|
||||
"Unknown") status="?" ;;
|
||||
*) exit 1 ;;
|
||||
esac
|
||||
capacity="$(cat "$battery/capacity" 2>&1)"
|
||||
|
||||
warn=""
|
||||
[ "$capacity" -le 25 ] && warn="!"
|
||||
|
||||
printf "%s[%s]%s" "$warn" "$capacity" "$status"
|
||||
done
|
||||
Reference in new issue
Block a user