dotfiles

Configuration for the software I use.
git clone https://git.sr.ht/~jbauer/dotfiles
Log | Files | Refs | README | LICENSE

commit 70fce794b8faf8560c9588cc4e5c698e8e927097
parent 327d37026ee220646d5513211f0cdcefd762dfd8
Author: Jake Bauer <jbauer@paritybit.ca>
Date:   Fri, 18 Jun 2021 22:25:11 -0400

Update status script

Diffstat:
M.local/bin/status | 29+++++++++++++++++++++++++++--
1 file changed, 27 insertions(+), 2 deletions(-)

diff --git a/.local/bin/status b/.local/bin/status @@ -2,12 +2,37 @@ while true; do cpuUtil=$(vmstat -c2| awk 'NR>2 {print 100-$(NF);}' | tail -1) - cpuTemp=$(sysctl hw.sensors.ksmn0.temp0 | cut -d= -f2 | cut -d. -f1) + cpuTemp=$(sysctl hw.sensors.cpu0.temp0 | cut -d= -f2 | cut -d. -f1) memUtil=$(top -1b | head -4 | tail -1 | cut -d' ' -f3 | cut -d'/' -f1) diskUtil=$(df -P | grep /home | awk '{print $5}') localTime=$(date +"%Y-%m-%d %H:%M") europeTime=$(TZ=Europe/Berlin date +"%H:%M") + battPerc=$(apm -l) + battLevel=$(apm -b) + battIcon="" + + case "$battLevel" in + "0") + battIcon="" + ;; + "1") + battIcon="" + ;; + "2") + battIcon="" + ;; + "3") + battIcon="" + ;; + "4") + battIcon="X" + ;; + *) + battIcon="?" + ;; + esac + # Begin NowPlaying Section nowPlaying=$(cmus-remote -Q 2>/dev/null) title=$(echo "$nowPlaying" | grep 'tag title' | cut -d' ' -f3-) @@ -49,5 +74,5 @@ while true; do fi # End NowPlaying Section - xsetroot -name "$nowPlaying;$cpuTemp°C $cpuUtil% $memUtil $diskUtil $localTime/$europeTime" + xsetroot -name "$nowPlaying;$cpuTemp°C $cpuUtil% $memUtil $diskUtil $battIcon$battPerc% $localTime/$europeTime" done