updated scripts

This commit is contained in:
2025-08-23 19:28:41 +02:00
parent 98bd7c5393
commit f0739adf34
5 changed files with 11 additions and 10 deletions

View File

@@ -1,7 +1,7 @@
#!/bin/bash
USAGE=$(mpstat 1 1 | awk '/Average:/ {print 100 - $12}')
TEMP=$(cat /sys/class/hwmon/hwmon3/temp1_input)
TEXT="$(printf "%.1f" $(echo "$USAGE"))% TEMP: $(printf "%.1f" $(echo "scale=2; $TEMP"/1000 | bc -l))C"
TEXT="$(printf "%.1f" $(echo "$USAGE"))% $(printf "%.1f" $(echo "scale=2; $TEMP"/1000 | bc -l))C"
CPU=$(lscpu | grep 'Model name' | awk -F': ' '{print $2}' | sed 's/^[ \t]*//')
# TOOLTIP=$(ps -eo %cpu,comm --sort=-%cpu | head -n 6 | sed '1d' | awk '{output = output sprintf("%.1f%%\t%s\\n", $1, $2)} END {printf "%s", output}')
# TOOLTIP=$(ps -eo %cpu,comm --sort=-%cpu | head -n 6 | sed '1d' | awk -v ncores=$(nproc) '{printf "%.1f%%\t%s\n", $1/ncores, $2}')

View File

@@ -6,7 +6,7 @@ EDGE_TEMP=$(cat /sys/class/drm/card1/device/hwmon/hwmon2/temp1_input)
JUNC_TEMP=$(cat /sys/class/drm/card1/device/hwmon/hwmon2/temp2_input)
MEM_TEMP=$(cat /sys/class/drm/card1/device/hwmon/hwmon2/temp3_input)
GPU=$(/opt/rocm/bin/rocm-smi --showproductname | grep "Card Series" | awk -F':' '{print $3}' | xargs)
TEXT="$USAGE% $(printf "%.1f" $(echo "scale=2; $MEM_USED/1024/1024/1024" | bc -l))/$(printf "%.1f" $(echo "scale=2; $MEM_TOTAL/1024/1024/1024" | bc -l))GB TEMP: $(printf "%.1f" $(echo "scale=2; $EDGE_TEMP/1000" | bc -l))/$(printf "%.1f" $(echo "scale=2; $JUNC_TEMP/1000" | bc -l))/$(printf "%.1f" $(echo "scale=2; $MEM_TEMP/1000" | bc -l))C"
TEXT="$USAGE% $(printf "%.1f" $(echo "scale=2; $MEM_USED/1024/1024/1024" | bc -l))/$(printf "%.1f" $(echo "scale=2; $MEM_TOTAL/1024/1024/1024" | bc -l))GB $(printf "%.1f" $(echo "scale=2; $EDGE_TEMP/1000" | bc -l))/$(printf "%.1f" $(echo "scale=2; $MEM_TEMP/1000" | bc -l))C"
RATIO=$(echo "$MEM_USED/ $MEM_TOTAL" | bc -l)
CLASS=""

View File

@@ -15,4 +15,4 @@ else
CLASS="normal"
fi
printf '{"text": "MEM: %s/%sGB", "tooltip": "%s", "class": "%s"}' "$USED" "$TOTAL" "$TOOLTIP" "$CLASS"
printf '{"text": "%s/%sGB", "tooltip": "%s", "class": "%s"}' "$USED" "$TOTAL" "$TOOLTIP" "$CLASS"