Sorry, da habe ich mich vertippt, ich meinte das A3N, das wird von dem
Modul bis jetzt noch nicht nativ unterstützt. Ich habe einen kleinen
Patch gebastelt, der die Unterstützung für das A3N und das V6V
hinzufügt. Bitte testet das einmal.
Außerdem habe ich ein Skript für das Handling der Events im V6V
angehängt als Beispiel, das für das A3N entsprechend anzupassen ist.
Mein Dank geht hier an Manfred Tremmel, dessen Original mir als Vorlage
diente.
Gruß, Johannes
#!/bin/bash
# acpi_hotkeys_ASUS_V6V
# Manfred Tremmel, based on the script of Stefan Seyfried
# modified for the use on ASUS V6V by Johannes Engel
#
PATH=/bin:/usr/bin # be paranoid, we're running as root.
# first get helper functions (e.g. DEBUG, load_scheme, ...), extend $PATH,
# set variables etc. We get $SCRIPT_RETURN from here
. "/usr/lib/powersave/scripts/helper_functions"
# get_x_user comes from here...
. "/usr/lib/powersave/scripts/x_helper_functions"
export PATH
MYNAME=${0##*/} # basename $0
#
# look into the example_event_script for an explanation. We need this for
# $SCRIPT_RETURN
NUM=$4
# previously, we checked for $# <= 3. This is not very future-proof ;-)
if [ -z "$NUM" ]; then
logger -t $MYNAME 'Sorry, not enough arguments: $4 is empty.'
$SCRIPT_RETURN "$NUM|1|$MYNAME finished unsuccessful."
exit 1
fi
run_on_xserver() {
get_x_user
su $X_USER -c "DISPLAY=$DISP $1"
}
TYPE=$1
set $3 # powersaved gives us "other ''" so we must split it.
EVENT=$1 # "hotkey"
ACPI=$2 # "HOTK"
WHAT=$3 # "00000052"
SERIAL=$4 # "0000001c"
# it is easier to deal with numerical values (for me :-)
declare -i VAL
VAL=0x$WHAT # hex -> decimal
ret=0
if [ "$EVENT" != "hotkey" ]; then
logger -t $MYNAME "non-hotkey-event: $TYPE $EVENT $ACPI $WHAT $SERIAL"
# do not exit here, we need to execute SCRIPT_RETURN_HELPER
elif [ $VAL -gt 16 -a $VAL -lt 48 ]; then # brightness up/down
: # do nothing
elif [ $VAL -eq 51 -o $VAL -eq 52 ]; then # LCD on/off
: # do nothing
elif [ $VAL -ge 97 -a $VAL -le 99 ]; then # internal/external/both
echo $VAL > /proc/acpi/asus/disp
: # do nothing
elif [ $VAL -eq 50 ]; then # Fn-F10 -> mute
if [ "`run_on_xserver '/opt/kde3/bin/dcop kmix | grep -c -m 1 kmix'`" = "1" ] ; then
if [ "`run_on_xserver '/opt/kde3/bin/dcop kmix Mixer0 mute 0'`" = "false" ] ; then
run_on_xserver "/opt/kde3/bin/dcop kmix Mixer0 setMute 0 true" &
else
run_on_xserver "/opt/kde3/bin/dcop kmix Mixer0 setMute 0 false" &
fi
else
mute & # from the aumix package
fi
: # set loudness to 0
elif [ $VAL -eq 49 ]; then # Fn-F11 -> volume down
if [ "`run_on_xserver '/opt/kde3/bin/dcop kmix | grep -c -m 1 kmix'`" = "1" ] ; then
run_on_xserver "/opt/kde3/bin/dcop kmix Mixer0 decreaseVolume 0" &
else
aumix -w -3 & # needs aumix, does "pcm"
fi
: # reduce loudness
elif [ $VAL -eq 48 ]; then # Fn-F12 -> volume up
if [ "`run_on_xserver '/opt/kde3/bin/dcop kmix | grep -c -m 1 kmix'`" = "1" ] ; then
run_on_xserver "/opt/kde3/bin/dcop kmix Mixer0 increaseVolume 0" &
else
aumix -w +3 & # needs aumix, does "pcm"
fi
: # increase loudness
elif [ $VAL -eq 81 ]; then # Start Browser
run_on_xserver "/opt/kde3/bin/kfmclient openProfile webbrowsing" &
: # do something
elif [ $VAL -eq 93 ]; then # Wireles LAN
RF_KILL=`find /sys/bus/pci/drivers/ipw2200/0*/rf_kill`
if [ "x${RF_KILL}" != "x" ] ; then # only when driver is available
WLAN_STATE=`cat "$RF_KILL"`
#DCOP_KINTERNET=`run_on_xserver '/opt/kde3/bin/dcop | grep kinternet'`
if [ "${WLAN_STATE}" = "0" ] ; then # wlan is enabled
# disable wlan
echo 1 > "${RF_KILL}"
# switch off wlan LED
echo 0 > /proc/acpi/asus/wled
else
# enable wlan
echo 0 > "${RF_KILL}"
# turn on wlan LED
echo 1 > /proc/acpi/asus/wled
fi
fi
: # togle wlan state activated/deactivated
elif [ $VAL -eq 92 ]; then # Power4 Gear +
POWERSAVESTATE=`/usr/bin/powersave -x | grep active | awk -F " " '{print $1}'`
case "$POWERSAVESTATE" in
Performance)
NEWPOWERSAVESTATE="Acoustic"
;;
Acoustic)
NEWPOWERSAVESTATE="Presentation"
;;
Presentation)
NEWPOWERSAVESTATE="Powersave"
;;
*)
NEWPOWERSAVESTATE="Performance"
;;
esac
/usr/bin/powersave -e ${NEWPOWERSAVESTATE}
run_on_xserver "/opt/kde3/bin/kdialog --passivepopup \"New Powersave state ${NEWPOWERSAVESTATE}\" 2" &
: # switching powersave states
elif [ $VAL -eq 106 ]; then # touchpad on/off
if [ -x /usr/local/bin/synclient ]; then
/usr/local/bin/synclient TouchpadOff=0
echo 1 > /proc/acpi/asus/tled
fi
: # turn touchpad on
elif [ $VAL -eq 107 ]; then # touchpad on/off
if [ -x /usr/local/bin/synclient ] ; then
/usr/local/bin/synclient TouchpadOff=1
echo 0 > /proc/acpi/asus/tled
fi
: # turn touchpad off
elif [ $VAL -eq 109 ]; then # suspend2disk
/usr/bin/powersave -U
: # abused for suspend2ram
else
DEBUG "undefined hotkey: $VAL $TYPE $EVENT $ACPI $WHAT $SERIAL" DIAG
ret=1
fi
#
# see example_event_script for an explanation.
$SCRIPT_RETURN "$RET|0|acpi_hotkeys_ASUS_V6V"
#