mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-21 22:13:19 -07:00
usr/lib/byobu/cpu_temp: find the temp monitor, LP: #676080
This commit is contained in:
parent
06978debbb
commit
1997b0737b
2 changed files with 17 additions and 8 deletions
1
debian/changelog
vendored
1
debian/changelog
vendored
|
@ -11,6 +11,7 @@ byobu (3.20) unreleased; urgency=low
|
||||||
usr/share/man/man1/Makefile.am:
|
usr/share/man/man1/Makefile.am:
|
||||||
- add an option for -n|--no-logout to byobu-launcher-install,
|
- add an option for -n|--no-logout to byobu-launcher-install,
|
||||||
document changes in new manpages, LP: #604931
|
document changes in new manpages, LP: #604931
|
||||||
|
* usr/lib/byobu/cpu_temp: find the temp monitor, LP: #676080
|
||||||
|
|
||||||
-- Dustin Kirkland <kirkland@ubuntu.com> Tue, 28 Dec 2010 00:05:13 -0600
|
-- Dustin Kirkland <kirkland@ubuntu.com> Tue, 28 Dec 2010 00:05:13 -0600
|
||||||
|
|
||||||
|
|
|
@ -31,14 +31,22 @@ if [ "$1" = "--detail" ] && [ -d "$DIR" ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for i in $MONITORED_TEMP /proc/acpi/ibm/thermal $DIR/*/temperature; do
|
for i in $MONITORED_TEMP /sys/class/hwmon/hwmon*/temp*_input /proc/acpi/ibm/thermal $DIR/*/temperature; do
|
||||||
if [ "$TEMP" = "F" ]; then
|
case "$i" in
|
||||||
t=$(sed -e "s/^[^0-9]\+//" -e "s/\s.*$//" "$i" | awk '{printf "%.0f", $1 *9/5 + 32}')
|
*temp*_input)
|
||||||
unit="F"
|
t=$(awk '{printf "%0.f",$1/1000}' "$i")
|
||||||
else
|
;;
|
||||||
|
*)
|
||||||
t=$(sed -e "s/^[^0-9]\+//" -e "s/\s.*$//" "$i")
|
t=$(sed -e "s/^[^0-9]\+//" -e "s/\s.*$//" "$i")
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
if [ -n "$t" ]; then
|
||||||
unit="C"
|
unit="C"
|
||||||
|
if [ "$TEMP" = "F" ]; then
|
||||||
|
t=$(echo "$t" | awk '{printf "%.0f", $1 *9/5 + 32}')
|
||||||
|
unit="F"
|
||||||
fi
|
fi
|
||||||
printf "$(color b k Y)%s$(color -)$(color k Y)\260%s$(color -) " "$t" "$unit"
|
printf "$(color b k Y)%s$(color -)$(color k Y)\260%s$(color -) " "$t" "$unit"
|
||||||
break
|
break
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue