#!/bin/sh cpu_count=4 low=25 high=75 icon_low=󰒲 icon_mid=󰜎 icon_high=󱅝 #min_avg_usage=$(vmstat | tail -1 | cut -w -f17) avg_load=$(sysctl vm.loadavg | cut -w -f3) percent=$(echo "result = $avg_load / $cpu_count * 100; scale=0; result / 1" | bc -l) [ $percent -lt $low ] && printf $icon_low [ $percent -ge $low ] && [ $percent -lt $high ] && printf $icon_mid [ $percent -ge $high ] && printf $icon_high printf " %s%%\n" $percent