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

@@ -1,6 +1,6 @@
#!/bin/sh
TOOLTIP=$(ps -eo rss,comm --sort=-rss | head -n 6 | sed '1d' | awk '{output = output sprintf("%.2f GB\t%s\\n", $1/1024/1024, $2)} END {printf "%s", output}')
# TOOLTIP=$(ps -eo rss,comm --sort=-rss | head -n 6 | sed '1d' | awk '{output = output sprintf("%.2f GB\t%s\\n", $1/1024/1024, $2)} END {printf "%s", output}')
TOTAL=$(awk '/MemTotal/ {printf "%.2f\n", $2/1024/1024}' /proc/meminfo)
USED=$(awk '/MemTotal/ {total=$2} /MemAvailable/ {available=$2} END {printf "%.2f\n", (total-available)/1024/1024}' /proc/meminfo)
RATIO=$(echo "$USED/ $TOTAL" | bc -l)
@@ -15,4 +15,5 @@ else
CLASS="normal"
fi
printf '{"text": "%s/%sGB", "tooltip": "%s", "class": "%s"}' "$USED" "$TOTAL" "$TOOLTIP" "$CLASS"
# printf '{"text": "%s/%sGB", "tooltip": "%s", "class": "%s"}' "$USED" "$TOTAL" "$TOOLTIP" "$CLASS"
printf '{"text": "%s/%sGB", "class": "%s"}' "$USED" "$TOTAL" "$CLASS"