dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit d8ecba03d3cd80d90f041cd077070dc2ad074f34
parent ed6c30c23265b488b4731e1453cdf47685b73781
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Thu, 26 Sep 2019 12:07:42 +0200

Add CPU temperature, fix spacing between battery charge and remaining time

Diffstat:
M.local/bin/sysstatus | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/.local/bin/sysstatus b/.local/bin/sysstatus @@ -24,7 +24,10 @@ printf " $separator" # cpu printf " " -if type sensors >/dev/null 2>&1; then +if type sysctl >/dev/null 2>&1; then + printf "%s " "$(sysctl hw.sensors.cpu0.temp0 | \ + sed 's/.*=//;s/\.[0-9]* deg/°/')" +elif type sensors >/dev/null 2>&1; then printf "%s " "$(sensors | grep -n 'Core 0:' | awk '{print $3}')" fi if [ -f /proc/loadavg ]; then @@ -37,7 +40,7 @@ printf " $separator" # battery if type apm >/dev/null 2>&1; then printf " %s" "$(apm | grep -o -E "[0-9]*%")" - printf " %s" "$(apm | grep -o -E "[0-9]* min")" + printf "%s" "$(apm | grep -o -E " [0-9]* min")" printf " $separator" elif [ -d "/sys/class/power_supply/$battery" ]; then battery=BAT0