mirror of
https://github.com/FelixKratz/SketchyBar
synced 2024-11-27 05:40:17 +00:00
11 lines
324 B
Bash
11 lines
324 B
Bash
|
#!/usr/bin/env bash
|
||
|
|
||
|
TOPMEM=$(ps axo "rss,ucomm" | sort -nr | tail +1 | head -n1 | awk '{printf "%.0fMB %s\n", $1 / 1024, $2}' | sed -e 's/com.apple.//g')
|
||
|
MEM=$(echo $TOPMEM | sed -nr 's/([^MB]+).*/\1/p')
|
||
|
|
||
|
if [ $MEM -gt 2048 ]; then
|
||
|
sketchybar -m set topmem label " $TOPMEM"
|
||
|
else
|
||
|
sketchybar -m set topmem label ""
|
||
|
fi
|