aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorMitch Riedstra <mitch@riedstra.us>2020-11-23 16:26:57 -0500
committerMitch Riedstra <mitch@riedstra.us>2020-11-23 16:26:57 -0500
commitdfd1a6150dd897da398990d471087c1d7e1deac1 (patch)
tree4c8602515f32f6c630cb534fe5992119961632b8 /bin
parent8ad9d13123d31697b7cab4c42df5e6273e8bcc1e (diff)
downloaddotfiles-dfd1a6150dd897da398990d471087c1d7e1deac1.tar.gz
dotfiles-dfd1a6150dd897da398990d471087c1d7e1deac1.tar.xz
Update the status bar for my dell7590
Diffstat (limited to 'bin')
-rwxr-xr-xbin/status-bar15
1 files changed, 11 insertions, 4 deletions
diff --git a/bin/status-bar b/bin/status-bar
index d6ac7a5..87aa18e 100755
--- a/bin/status-bar
+++ b/bin/status-bar
@@ -44,8 +44,8 @@ network_info() {
}
-ac_status() {
- sudo tlp-stat -b | awk '/\/status/{print $3}'
+batt_status() {
+ sudo tlp-stat -b | awk 'BEGIN{ORS=" "} /\/status/{print $3}/^Charge/{print $3}';
}
cpu_freq() {
@@ -57,7 +57,7 @@ echo \
"Temp: $(sensors | sed -n 's/^temp1:[\t ]*//p' | sed 's/ *//g' | sed 1q | tr -d '\n')|"\
"Fan: $(sensors | sed -n 's/^fan1:[\t ]*//p')|"\
"Cpu Freq: $(cpu_freq)mhz|"\
-"Batt: $(sudo tlp-stat -b | awk '/^Charge/{print $3}') $(ac_status)|"\
+"Batt: $(batt_status)|"\
"$(network_info)|"\
"Free Mem: $(_sys_memory)|"\
"Uptime: $(_sys_uptime)|"\
@@ -67,7 +67,14 @@ echo \
x230_status_line() {
echo \
"Fan: $(sensors | sed -n 's/^fan1:[\t ]*//p')|"\
-"Batt: $(sudo tlp-stat -b | awk '/^Charge/{print $3}') $(ac_status)|"\
+"Batt: $(batt_status | sed -e's/ *$//g')|"\
+"$(network_info)|"\
+"$(date '+%m.%d.%Y %H:%M:%S')"
+}
+
+dell7590_status_line() {
+echo \
+"Batt: $(batt_status | sed -e's/ *$//g')|"\
"$(network_info)|"\
"$(date '+%m.%d.%Y %H:%M:%S')"
}