inital commit
This commit is contained in:
28
temps-dwm
Executable file
28
temps-dwm
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/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"
|
||||
Reference in New Issue
Block a user