1
1
mirror of https://github.com/nboughton/dotfiles synced 2025-02-17 01:51:15 +01:00
github.com-nboughton-dotfiles/waybar/modules/cputemp
2021-08-17 20:32:59 +01:00

14 lines
361 B
Bash
Executable File

#!/bin/bash
temp=$(sensors -A dell_smm-virtual-0 | grep CPU | awk '{print $2}' | sed -e 's/+//' -e 's/\.0//')
class="normal"
pct=$(echo $temp | sed -e 's/°C//')
if [[ $pct -gt 79 ]]; then
class="warning"
elif [[ $pct -gt 99 ]]; then
class="critical"
fi
echo "{\"text\": \"$temp\", \"tooltip\": \" ${temp}\", \"class\": \"$class\", \"percentage\": $pct }"