X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=home%2Flib%2Flogin_functions.sh;h=1f6906100e840a0ef05bc97c48e207f5deb8e109;hb=15f22284bb881be22ea8af6b36a857a17628706a;hp=cae7b990afcd3791903426b51e8d65b1cd4acb6b;hpb=713423d0746543e393a72bfe1a600d024d064485;p=khome.git diff --git a/home/lib/login_functions.sh b/home/lib/login_functions.sh index cae7b99..1f69061 100644 --- a/home/lib/login_functions.sh +++ b/home/lib/login_functions.sh @@ -334,7 +334,7 @@ EOF work_log() { mkdir -p "$DIR_WORK_LOG" - local -r file_work_log_today="${DIR_WORK_LOG}/$(date +%F).md" + local -r file_work_log_today="${DIR_WORK_LOG}/daily-$(date +%F).md" if [ ! -f "$file_work_log_today" ] then work_log_template > "$file_work_log_today" @@ -556,14 +556,29 @@ status() { echo + local _dir temp_input label_file label + printf '%sthermal\n' "$indent_unit" - for _dir in /sys/class/thermal/thermal_zone* - do - printf '%s %.2f C\n' \ - $(cat "$_dir"/type) \ - $(( $(cat "$_dir"/temp) / 1000 )) + for _dir in /sys/class/hwmon/hwmon*; do + cat "$_dir"/name + find "$_dir"/ -name 'temp*_input' \ + | while read -r temp_input; do + label_file=${temp_input//_input/_label} + if [ -f "$label_file" ]; then + label=$(< "$label_file") + else + label='' + fi + awk -v label="$label" '{ + if (label) + label = sprintf(" (%s)", label) + printf("%.2f°C%s\n", $1 / 1000, label) + }' \ + "$temp_input" + done \ + | sort \ + | indent "$indent_unit" done \ - | column -t \ | indent "${indent_unit}${indent_unit}" echo 'net'