aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/status-bar19
1 files changed, 16 insertions, 3 deletions
diff --git a/bin/status-bar b/bin/status-bar
index 5a5eba1..f73879a 100755
--- a/bin/status-bar
+++ b/bin/status-bar
@@ -1,5 +1,5 @@
#!/bin/sh
-timeout=61
+timeout=10
_sys_memory() {
free -m | awk '/^Mem/{print $6;exit 0;}'
@@ -52,7 +52,19 @@ pine_batt_status() {
batt_status() {
# sudo tlp-stat -b | awk 'BEGIN{ORS=" "} /\/status/{print $3}/^Charge/{print $3}';
- cat /sys/class/power_supply/BAT0/capacity
+ printf "%s %s" \
+ "$(cat /sys/class/power_supply/BAT0/capacity)" \
+ "$(charging_status)"
+}
+
+charging_status() {
+ if [ "$(cat /sys/class/power_supply/AC/online)" = "1" ] ; then
+ printf "Charging"
+ elif [ "$(cat /sys/class/power_supply/AC/online)" = "0" ] ; then
+ printf "Discharging"
+ else
+ printf "Unknown charging status"
+ fi
}
cpu_freq() {
@@ -97,7 +109,7 @@ sensors | sed -n '/^k10/,/^$/p' | awk '/^Tctl/{print $2}' \
}
pine_Temp() {
- sensors | sed -n -e 's/^temp1[ \t:]*//p' | sed 1q
+ sensors | sed -n -e 's/^temp1[ \t:]*//p' | sed 1q
}
pine_status_line() {
@@ -148,5 +160,6 @@ echo \
_type="$1"; shift
while true ; do
xsetroot -name "$("${_type}_status_line" "$@")"
+# echo "$("${_type}_status_line" "$@")"
sleep "$timeout"
done