calculate max cpu temp no matter how many temp zones

This commit is contained in:
Cyryl Płotnicki 2019-10-22 16:52:31 +01:00
parent 83aa587e9c
commit 68e90ed5dd
3 changed files with 12 additions and 4 deletions

9
cpu-temp.sh Executable file
View file

@ -0,0 +1,9 @@
#!/bin/sh
profile="$HOME/.nix-profile/bin/"
system="/run/current-system/sw/bin/"
sensors="$profile/sensors"
max_temp=`$sensors | $system/egrep -o '[0-9][0-9]\.[0-9]' | $system/sort | $system/uniq | $system/tail -n 1`
echo "${max_temp}°C"

View file

@ -14,7 +14,7 @@ in
};
};
home.packages = with pkgs; [
cabal-install stack hsetroot
cabal-install stack hsetroot lm_sensors
wirelesstools ranger xpdf apvlv unstable.xidlehook blueman
fontconfig nodejs rustup gcc gdb
binutils xclip pkgconfig veracrypt gitAndTools.diff-so-fancy

View file

@ -56,10 +56,9 @@
};
"module/temperature" = {
type = "internal/temperature";
thermal-zone = 3;
type = "custom/script";
interval = 5;
format = "TEMP: <label>";
exec = "~/dev/dotfiles/cpu-temp.sh";
};
"module/memory" = {