updated waybar
This commit is contained in:
@@ -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"
|
||||
|
Reference in New Issue
Block a user