aboutsummaryrefslogtreecommitdiff
path: root/templates/.bin/get_cpu
blob: 4f668336a1cc0a28e823433ac99c6abab054348c (plain)
1
2
3
4
5
6
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