Enable pgtk and native comp for emacs.
This commit is contained in:
@@ -9,15 +9,24 @@ SLEEP_INTERVAL=${SLEEP_INTERVAL:-30}
|
||||
|
||||
while true; do
|
||||
# TODO: Why not vm.stats.vm.v_page_size ? Are these the same?
|
||||
page_size=$(sysctl -n hw.pagesize)
|
||||
free_pages=$(sysctl -n vm.stats.vm.v_free_count)
|
||||
free_bytes=$((page_size * free_pages))
|
||||
total_pages=$(sysctl -n vm.stats.vm.v_page_count)
|
||||
page_size=$(sysctl -n hw.pagesize)
|
||||
active=$(sysctl -n vm.stats.vm.v_active_count)
|
||||
inactive=$(sysctl -n vm.stats.vm.v_inactive_count)
|
||||
in_use_pages=$((active + inactive))
|
||||
free_pages=$((total_pages - in_use_pages))
|
||||
free_bytes=$((page_size * free_pages))
|
||||
free_percent=$((100 * free_pages / total_pages))
|
||||
text=""
|
||||
|
||||
if [ $free_bytes -ge $((1024 * 1024 * 1024)) ]; then
|
||||
text="$((free_bytes / 1024 / 1024 / 1024)) GiB"
|
||||
elif [ $free_bytes -ge $((1024 * 1024)) ]; then
|
||||
text="$((free_bytes / 1024 / 1024)) MiB"
|
||||
elif [ $free_bytes -ge 1024 ]; then
|
||||
text="$((free_bytes / 1024)) KiB"
|
||||
else
|
||||
text="$(free_bytes) B"
|
||||
fi
|
||||
|
||||
tooltip="${free_percent}%"
|
||||
|
||||
Reference in New Issue
Block a user