Files
sydnix/modules/home/users/crumb/waybar/src/cputemp
Madeleine Sydney c48a93ad10 feat: Add host sydpc
My, this is a lot TwT.  Much work was batched as part of the transition from
guix-rebound to nixos-testbed/sydpc.

- Discord/Vesktop module & config.
- Syncthing setup.
- Assorted Emacs changes.
- Waybar config.
- Niri config.
- Steam config.
- Some MPD.
- Stylix config.
- Files/Impermanence things.
- Enable Ghostty.
- God knows what else.
2025-03-20 09:02:25 -06:00

46 lines
853 B
Bash
Executable File

#!/usr/bin/env bash
check() {
command -v "$1" 1>/dev/null
}
check sensors || exit
data="$(sensors coretemp-isa-0000 | sed 's/+//g')"
package="$(echo "$data" | awk -e '/Package/ {print $4}')"
coretemp="$(echo "$data" | awk -e '/Core/ {print $3}')"
tooltip="<b>Core Temp: $package </b>\n"
# "format-icons" : [ "", "", "", "", "" ] ,
tempint=''${package%.*}
temp="<b>''${tempint}󰔄</b>"
# icon=""
class="cool"
[ "$tempint" -gt 50 ] && {
# icon=""
class="normal"
}
[ "$tempint" -gt 70 ] && {
# icon=" "
class="warm"
}
[ "$tempint" -gt 85 ] && {
# icon=" "
class="warn"
}
[ "$tempint" -gt 95 ] && {
# icon=" "
class="critical"
}
j=0
for i in $coretemp; do
tooltip+="Core $j: $i\n"
((j = j + 1))
done
tooltip="''${tooltip::-2}"
cat <<EOF
{"text":"$temp","tooltip":"$tooltip", "class": "$class"}
EOF