updated waybar

This commit is contained in:
2025-08-28 19:45:40 +02:00
parent bd49925080
commit a1ac6850bb
7 changed files with 167 additions and 35 deletions

View File

@@ -5,7 +5,7 @@ TEXT="$(printf "%.1f" $(echo "$USAGE"))% $(printf "%.1f" $(echo "scale=2; $TEMP"
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}')
TOOLTIP=$(ps -eo %cpu,comm --sort=-%cpu | head -n 6 | sed '1d' | awk -v ncores=$(nproc) '{printf "%.1f%%\t%s\\n", $1/ncores, $2}')
# TOOLTIP=$(ps -eo %cpu,comm --sort=-%cpu | head -n 6 | sed '1d' | awk -v ncores=$(nproc) '{printf "%.1f%%\t%s\\n", $1/ncores, $2}')
# TOOLTIP=$(top -b -n 1 | sed '1,7d' | head -n 5 | awk '{output = output sprintf("%.1f%%\t%s\\n", $9, $12)} END {printf "%s", output}')
CLASS=""
@@ -18,4 +18,5 @@ else
CLASS="normal"
fi
echo "{\"text\":\"CPU: $TEXT\", \"tooltip\": \"$TOOLTIP\", \"class\":\"$CLASS\"}"
# echo "{\"text\":\"CPU: $TEXT\", \"tooltip\": \"$TOOLTIP\", \"class\":\"$CLASS\"}"
echo "{\"text\":\"CPU: $TEXT\", \"class\":\"$CLASS\"}"