I've deleted wrong script.
This commit is contained in:
parent
17eebf0e42
commit
5d4432c770
17
_gui/_scripts/sb-battery
Executable file
17
_gui/_scripts/sb-battery
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
for battery in /sys/class/power_supply/BAT?*; do
|
||||||
|
# If non-first battery, print a space separator.
|
||||||
|
[ -n "${capacity+x}" ] && printf " "
|
||||||
|
# Sets up the status and capacity
|
||||||
|
case "$(cat "$battery/status")" in
|
||||||
|
"Full") status="\uf102" ;;
|
||||||
|
"Discharging") status="\uf078" ;;
|
||||||
|
"Charging") status="\uf077" ;;
|
||||||
|
"Not charging") status="\uf444"; exit 0 ;;
|
||||||
|
"Unknown") status="\uf128" ;;
|
||||||
|
esac
|
||||||
|
capacity=$(cat "$battery/capacity")
|
||||||
|
# Will make a warn variable if discharging and low
|
||||||
|
[ "$capacity" -le 20 ] && printf "<span size='140%%' background='#770000' foreground='#ffffff'>${status} ${capacity}%%</span>" || printf "${status} ${capacity}%%"
|
||||||
|
done && exit 0
|
@ -1,8 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
ip a | grep -q wg0 && wg_status="wireguard running " || wg_status=""
|
|
||||||
case "$(cat /sys/class/net/wlan0/operstate 2>/dev/null)" in
|
|
||||||
down) printf "${wg_status} no wifi" ;;
|
|
||||||
up)
|
|
||||||
[ -n "$(ip address show dev wlan0 | grep 'inet ')" ] && printf "${wg_status}"|| printf "${wg_status}no ip" ;;
|
|
||||||
esac
|
|
Loading…
Reference in New Issue
Block a user