mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-21 14:03:18 -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:
|
||||
- add an option for -n|--no-logout to byobu-launcher-install,
|
||||
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
|
||||
|
||||
|
|
|
@ -31,14 +31,22 @@ if [ "$1" = "--detail" ] && [ -d "$DIR" ]; then
|
|||
exit 0
|
||||
fi
|
||||
|
||||
for i in $MONITORED_TEMP /proc/acpi/ibm/thermal $DIR/*/temperature; do
|
||||
if [ "$TEMP" = "F" ]; then
|
||||
t=$(sed -e "s/^[^0-9]\+//" -e "s/\s.*$//" "$i" | awk '{printf "%.0f", $1 *9/5 + 32}')
|
||||
unit="F"
|
||||
else
|
||||
for i in $MONITORED_TEMP /sys/class/hwmon/hwmon*/temp*_input /proc/acpi/ibm/thermal $DIR/*/temperature; do
|
||||
case "$i" in
|
||||
*temp*_input)
|
||||
t=$(awk '{printf "%0.f",$1/1000}' "$i")
|
||||
;;
|
||||
*)
|
||||
t=$(sed -e "s/^[^0-9]\+//" -e "s/\s.*$//" "$i")
|
||||
;;
|
||||
esac
|
||||
if [ -n "$t" ]; then
|
||||
unit="C"
|
||||
if [ "$TEMP" = "F" ]; then
|
||||
t=$(echo "$t" | awk '{printf "%.0f", $1 *9/5 + 32}')
|
||||
unit="F"
|
||||
fi
|
||||
printf "$(color b k Y)%s$(color -)$(color k Y)\260%s$(color -) " "$t" "$unit"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue