-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtemp
45 lines (43 loc) · 1.59 KB
/
temp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/sh
# This script requires you install lm-sensors
if [ -n "$3" ];then
temp=$(sensors -Au | grep "$1" -A 1 | tail -1 | awk '{print int($2)}')
else
temp=$(sensors -Au | grep "$1" -A 1 | tail -1 | awk '{print $2}')
fi
echo "<img>/usr/local/share/icons/hicolor/22x22/devices/sensors-applet-$2.png</img>"
if [ "$3" = "-F" ];then
temp="$(echo $temp | awk '{print $1*(9/5)+32}')°F"
echo "<txt>$temp</txt>"
echo "<tool>CPU Temperature $temp</tool>"
elif [ "$3" = "-C" ];then
echo "<txt>$temp°C</txt>"
echo "<tool>$1 $temp°C</tool>"
else
echo "<txt> $temp V</txt>"
echo "<tool>$1 $temp V</tool>"
fi
exit 0
# Usage
# temp [name] [icon] [celisus | ferinheight]
# Examples:
temp 'CPU Temperature' cpu -C
temp "Vcore Voltage" chip
temp "MB Temperature" memory -C
# Sameple sensors output:
# atk0110-acpi-0
# Adapter: ACPI interface
# Vcore Voltage: +1.32 V (min = +0.85 V, max = +1.70 V)
# +3.3 Voltage: +3.44 V (min = +2.97 V, max = +3.63 V)
# +5 Voltage: +5.05 V (min = +4.50 V, max = +5.50 V)
# +12 Voltage: +12.56 V (min = +10.20 V, max = +13.80 V)
# CPU FAN Speed: 808 RPM (min = 600 RPM, max = 7200 RPM)
# CHASSIS FAN Speed: 934 RPM (min = 600 RPM, max = 7200 RPM)
# CHASSIS FAN 2 Speed: 754 RPM (min = 600 RPM, max = 7200 RPM)
# CPU Temperature: +26.0°C (high = +60.0°C, crit = +95.0°C)
# MB Temperature: +25.0°C (high = +45.0°C, crit = +75.0°C)
#
# k10temp-pci-00c3
# Adapter: PCI adapter
# temp1: +30.4°C (high = +70.0°C)
# (crit = +90.0°C, hyst = +88.0°C)