mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-23 06:36:17 -07:00
usr/lib/byobu/fan_speed: add support for /proc/i8k for some other
systems' fan speeds (e.g. Dell Inspiron), LP: #700204
This commit is contained in:
parent
f13a04c125
commit
1c9db76c01
2 changed files with 20 additions and 1 deletions
2
debian/changelog
vendored
2
debian/changelog
vendored
|
@ -15,6 +15,8 @@ byobu (3.26) unreleased; urgency=low
|
|||
|
||||
[ Dustin Kirkland + swalker <sdwalker@myrealbox.com> ]
|
||||
* usr/lib/byobu/wifi_quality: avoid potential divide by zero error
|
||||
* usr/lib/byobu/fan_speed: add support for /proc/i8k for some other
|
||||
systems' fan speeds (e.g. Dell Inspiron), LP: #700204
|
||||
|
||||
-- Dustin Kirkland <kirkland@ubuntu.com> Sun, 23 Jan 2011 16:28:45 -0600
|
||||
|
||||
|
|
|
@ -23,13 +23,16 @@ color 2>/dev/null || color() { true; }
|
|||
|
||||
DIR="/sys/class/hwmon"
|
||||
if [ "$1" = "--detail" ]; then
|
||||
for i in $DIR/*; do
|
||||
for i in $DIR/* /proc/i8k; do
|
||||
echo "$i:"
|
||||
cat "$DIR/$i"/* 2>/dev/null
|
||||
done
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Let's check a few different probes for fan speed
|
||||
|
||||
# This seems to cover most of them:
|
||||
for i in $(find $DIR/*/*/ -type f -name "fan1_input"); do
|
||||
speed=$(cat "$i")
|
||||
if [ "$speed" -gt 0 ]; then
|
||||
|
@ -37,3 +40,17 @@ for i in $(find $DIR/*/*/ -type f -name "fan1_input"); do
|
|||
exit 0
|
||||
fi
|
||||
done
|
||||
|
||||
# But others (e.g. Dell Inspirons) seem to be here:
|
||||
if [ -r /proc/i8k ]; then
|
||||
for speed in $(awk '{ print $7, $8 }' /proc/i8k); do
|
||||
if [ "$speed" -gt 0 ]; then
|
||||
# I8K_FAN_MULT defaults to 30 (buggy BIOS workaround?),
|
||||
# use `modprobe i8k fan_mult=1` to disable if unneeded,
|
||||
# resulting in nonsensical speeds
|
||||
[ "$speed" -gt 10000 ] && speed=$((${speed} / 30))
|
||||
printf "$(color bold1)%s$(color -)$(color none)%s$(color -) " "$speed" "rpm"
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue