aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorMitch Riedstra <mitch@riedstra.us>2020-11-26 00:20:16 -0500
committerMitch Riedstra <mitch@riedstra.us>2020-11-26 00:20:16 -0500
commit7e5db314ff67db14e91baee4169415087746d0d1 (patch)
tree21e3ba0c1d43e9b2bdc917fe10f84d05ad835484 /bin
parentdfd1a6150dd897da398990d471087c1d7e1deac1 (diff)
downloaddotfiles-7e5db314ff67db14e91baee4169415087746d0d1.tar.gz
dotfiles-7e5db314ff67db14e91baee4169415087746d0d1.tar.xz
Add a status bar for the new laptop
Diffstat (limited to 'bin')
-rwxr-xr-xbin/status-bar17
1 files changed, 16 insertions, 1 deletions
diff --git a/bin/status-bar b/bin/status-bar
index 87aa18e..9fb04c5 100755
--- a/bin/status-bar
+++ b/bin/status-bar
@@ -49,7 +49,13 @@ batt_status() {
}
cpu_freq() {
-cat /proc/cpuinfo | grep '^cpu MHz' | awk '{print $4}' | sort -nr | sed 1q
+# cat /proc/cpuinfo | grep '^cpu MHz' | awk '{print $4}' | sort -nr | sed 1q
+# Average out the CPU frequency
+cat /proc/cpuinfo | awk 'BEGIN{n=0;mhz=0;}/^cpu MHz/{mhz += $4;n++;}END{print mhz/n;}'
+}
+
+tlp_status() {
+tlp-stat -s | sed -n 's/^Mode *= //p'
}
status_line() {
@@ -79,6 +85,15 @@ echo \
"$(date '+%m.%d.%Y %H:%M:%S')"
}
+t495_status_line() {
+echo \
+"CPU: $(cpu_freq)|"\
+"TLP: $(tlp_status)|"\
+"Batt: $(batt_status | sed -e's/ *$//g')|"\
+"$(network_info)|"\
+"$(date '+%m.%d.%Y %H:%M:%S')"
+}
+
_type="$1"; shift
while true ; do
xsetroot -name "$("${_type}_status_line" "$@")"