Also honors battery_charging_sensor. - statusbar - Shell script to set/print a status bar
(HTM) hg clone https://bitbucket.org/iamleot/statusbar
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
---
(DIR) changeset 819ce865f6f308e0bcd07633e25d4773dcb4a4ad
(DIR) parent a12e919c5c80e10a3ab13459ea65adbfd1c8aaa6
(HTM) Author: Leonardo Taccari <iamleot@gmail.com>
Date: Tue, 27 Feb 2018 19:46:40
Also honors battery_charging_sensor.
Print a $charging_symbol if the battery is currently charging.
Diffstat:
statusbar.sh | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff -r a12e919c5c80 -r 819ce865f6f3 statusbar.sh
--- a/statusbar.sh Tue Feb 27 14:22:11 2018 +0100
+++ b/statusbar.sh Tue Feb 27 19:46:40 2018 +0100
@@ -33,6 +33,7 @@
#
acad_sensor="${STATUSBAR_ACAD_SENSOR}"
battery_sensor="${STATUSBAR_BATTERY_SENSOR}"
+battery_charging_sensor="${STATUSBAR_BATTERY_CHARGING_SENSOR}"
clock_format="${STATUSBAR_CLOCK_FORMAT}"
date_format="${STATUSBAR_DATE_FORMAT}"
mixer_mute="${STATUSBAR_MIXER_MUTE}"
@@ -52,6 +53,7 @@
# Symbols (mostly Unicode characters) used by the various functions.
#
acad_symbol="🔌"
+charging_symbol="⚡"
battery_symbol="🔋"
clock_symbol="⏰"
date_symbol="📅"
@@ -112,8 +114,11 @@
battery_status()
{
acad_connected=`envstat -s "$acad_sensor" | awk '/connected:/ { print $2 }'`
+ battery_charging=`envstat -s "$battery_charging_sensor" | awk '/charging:/ { print $2 }'`
- if [ "$acad_connected" = "TRUE" ]; then
+ if [ "$battery_charging" = "TRUE" ]; then
+ printf "%s " $charging_symbol
+ elif [ "$acad_connected" = "TRUE" ]; then
printf "%s " $acad_symbol
else
printf "%s " $battery_symbol