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.
This commit is contained in:
45
modules/home/users/crumb/waybar/src/cputemp
Executable file
45
modules/home/users/crumb/waybar/src/cputemp
Executable file
@@ -0,0 +1,45 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user