epic polybar config

This commit is contained in:
Ben Kyd
2023-05-16 17:47:39 +01:00
parent 1ce87eae90
commit e0857cc2bd
39 changed files with 2114 additions and 491 deletions

View File

@@ -0,0 +1,12 @@
#!/bin/sh
# Define array
ramp_arr=(▁ ▂ ▃ ▄ ▅ ▆ ▇ █)
sar -P ALL 1 1 | grep -E 'Average:\s+[0-9]+' | while read -r line ; do
val=$(echo $line | awk '{cpu_usage=$3} END {printf "%0.2f", cpu_usage}')
idx=`echo "scale=4; $val/14.3" | bc`
intidx=$( printf "%.0f" $idx )
printf "${ramp_arr[$intidx]}"
done
echo