aboutsummaryrefslogtreecommitdiff
path: root/templates/.bin/get_cpu
diff options
context:
space:
mode:
Diffstat (limited to 'templates/.bin/get_cpu')
-rwxr-xr-xtemplates/.bin/get_cpu7
1 files changed, 7 insertions, 0 deletions
diff --git a/templates/.bin/get_cpu b/templates/.bin/get_cpu
new file mode 100755
index 0000000..4f66833
--- /dev/null
+++ b/templates/.bin/get_cpu
@@ -0,0 +1,7 @@
+#!/usr/bin/zsh
+
+idle=$(mpstat -o JSON 1 1 | jq '.sysstat.hosts[0].statistics[0]["cpu-load"][0].idle')
+used=$((100.0 - $idle))
+temp=$(acpi --thermal | cut -d':' -f2 | cut -d',' -f2 | sed 's/[^0-9\.]//g')
+
+printf "<span font='FontAwesome'></span> %d%% %d°C\n" $used $temp