Dies ist das neue Wiki von debianforum.de. Der bisherige Wiki-Inhalt ist unter http://oldwiki.debianforum.de noch eine Zeit lang verfügbar.


Systemlautstaerke an Lüftergeschwindigkeit anpassen

Aus DebianforumWiki

Wechseln zu: Navigation, Suche
Review.png Review: Dieser Artikel ist für das Review freigegeben.


Getestet.png Lizenz: Dieser Artikel lässt keine offenen Lizenzfragen. D.h. er kann ohne Bedenken migriert werden.

Scripting / Scripting Hardware / SystemlautstaerkeAnLueftergeschwindigkeit

Dieses Skript erhöht automatisch die Systemlautstärke, sobald sich der Lüfter einschaltet. Das Skript sollte sich auch für ACPI umschreiben lassen. Es ist mit einem '&' zu starten, damit es im Hintergrund läuft. (08.09.2006)

###########################################################################
# This shell script adjusts the master volume according to particular fan #
# activity on Dell Inspiron Laptops (and maybe others).                   #
#                                                                         #
# Special requirements:                                                   #
# - working i8kutils                                                      #
# - aumix                                                                 #
###########################################################################
 
trap 'if [ "${MON_STATE}" = "1" ]; then aumix -v -${VOL_RANGE}; fi' EXIT
 
if [ `pidof i8kfvadj.sh|wc -w` -ge "1" ]; then
  pidof i8kfvadj.sh|wc -w
  exit 0
fi
 
# get the level from the 'vol xx, yy' output line
get_curr_vol () {
 CURR_VOL=`aumix -q| sed -n '/vol/ s/^vol \([^,]*\).*/\1/p'`
}
 
GET_FAN_STATE="i8kctl fan"
MON_STATE="0"
 
# define the fan states we want to handle
FAN_OFF="0 0"
FAN_STATE_1="1 0"
FAN_STATE_2="1 1"
FAN_STATE_3="2 2"
 
# define the corresponding volume ranges (in percent)
VOL_RANGE_1="5"
VOL_RANGE_2="7"
VOL_RANGE_3="9"
 
# set up the polling frequency (in seconds)
SLEEP_SEC="3"
 
while true
do
  FAN_STATE=`${GET_FAN_STATE}`
  if [ "${FAN_STATE}" = "${FAN_OFF}" ]; then
    if [ "${MON_STATE}" = "1" ]; then
      get_curr_vol
      EXPECTED_VOL=`expr ${CURR_VOL} - ${VOL_RANGE}`
      if [ ${EXPECTED_VOL} -gt "0" ]; then
        aumix -v -${VOL_RANGE}
        echo "vol-"
        echo /${CURR_VOL}/
      fi
      MON_STATE="0"
    fi
  else
    if [ "${MON_STATE}" = "0" ]; then
      case "${FAN_STATE}" in
        ${FAN_STATE_1} )
        VOL_RANGE=${VOL_RANGE_1}
        ;;
        ${FAN_STATE_2} )
        VOL_RANGE=${VOL_RANGE_2}
        ;;
        ${FAN_STATE_3} )
        VOL_RANGE=${VOL_RANGE_3}
        ;;
        * )
        VOL_RANGE="0"
        ;;
      esac
      get_curr_vol
      if [ "${CURR_VOL}" -gt "0" ]; then
        aumix -v +${VOL_RANGE}
        echo "vol+"
        echo /${CURR_VOL}/
      fi
      MON_STATE="1"
    fi
  fi
sleep ${SLEEP_SEC}
done

Scripting / Scripting Hardware / SystemlautstaerkeAnLueftergeschwindigkeit

Meine Werkzeuge