mirror of
https://github.com/nboughton/dotfiles
synced 2025-02-17 01:51:15 +01:00
14 lines
361 B
Bash
Executable File
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 }"
|
|
|