A small script in rust to get the cpu usage in %'s with a gradient color for the text
To get it to work on your PC you will have to make some changes to the path in the polybar settings (exec = ...) and the path in the .sh script You'll also have to make sure you compile it first
Inside polybar settings;
[module/cpus_usage]
type = custom/script
exec = ~/.config/polybar/scripts/cpu_usage.sh
tail = true
# Optional past this line
format-prefix-foreground = ${colors.primary}
format-prefix = CPU's: (
format-suffix = )
format-suffix-foreground = ${colors.primary}
label = %output%
and the cpu_usage.sh:
#!/bin/bash
~/Rusty/cpu_usage/target/release/cpu_usage