Files
nixos-config/home/programs/eww/src/scripts/cpu.sh
2025-05-03 01:16:02 +02:00

6 lines
160 B
Bash
Executable File

cpu_idle=$(top -bn1 | awk '/Cpu\(s\)/ {print $8}')
cpu_used=$(awk "BEGIN {print 100 - $cpu_idle}")
# Print only the numeric result
printf "%.0f\n" "$cpu_used"