From c09d91fe95fca4367f47c06fc808cd02a1a8e6a5 Mon Sep 17 00:00:00 2001 From: Ben Burwell Date: Tue, 13 Aug 2019 14:40:54 -0400 Subject: add bins --- templates/.bin/get_cpu | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 templates/.bin/get_cpu (limited to 'templates/.bin/get_cpu') 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 " %d%% %d°C\n" $used $temp -- cgit v1.2.3