Files

29 lines
723 B
Plaintext
Raw Permalink Normal View History

2022-03-26 15:33:05 +01:00
#!/bin/sh
case $BLOCK_BUTTON in
1) setsid "$TERMINAL" -e gotop &;;
3) notify-send "📰 Temperature module" "\- Shows Cpu temps items
- Left click opens gotop" ;;
6) setsid "$TERMINAL" -e "$EDITOR" "$0" &;;
esac
info=$(sensors)
temps=$(echo "$info" | grep "°C" | sed -r 's/^.*\+([0-9]+)\.[0-9]°C.*\(.*\).*$/\1/g')
fan=$(echo "$info" | grep "RPM" | sed -r 's/^.* ([0-9]+ RPM)/\1/g')
rec="0"
temps="$(for temp in $temps; do
[ "$temp" -gt "$rec" ] && rec="$temp"
echo $rec
done | tac | sed 1q)"
if [ "$temps" -gt "80" ]; then
icon=""
elif [ "$temps" -gt "50" ];then
icon=""
else
icon=""
fi
#echo "$temps"
printf "%s %s  %s\\n" "$icon" "$temps" "$fan"