+ printf '%smem by proc\n' "$indent_unit"
+ ps -eo rss,cmd \
+ | awk -v total="$(free | awk '$1 == "Mem:" {print $2; exit}')" '
+ NR > 1 {
+ rss = $1
+ cmd = $2
+ n = split(cmd, path, "/") # _may_ be a path
+ proc = path[n]
+ by_proc[proc] += rss
+ }
+
+ END {
+ for (proc in by_proc)
+ print by_proc[proc], total, proc
+ }
+ ' \
+ | flat_top_5 \
+ | indent "${indent_unit}${indent_unit}"
+
+ echo
+
+ local _dir temp_input label_file label
+
+ printf '%sthermal\n' "$indent_unit"
+ 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 \
+ | indent "${indent_unit}${indent_unit}"
+
+ echo 'net'
+ #local -r internet_addr=$(internet_addr 0.5)
+ #local -r internet_ptr=$(host -W 1 "$internet_addr" | awk 'NR == 1 {print $NF}' )
+
+ #echo "${indent_unit}internet"
+ #echo "${indent_unit}${indent_unit}$internet_addr $internet_ptr"