Slackware 12 su Asus Z99j o Aj8n - Gestione ACPI e tasti funzione

Apena installata, la mia distro preferita (ovviamente Slackware 12) ACPI aveva qualche problama.
Sulla barra non compariva l’icona del controllo delle batterie e i tasti funzione non funzionavano 🙂
Ecco come ho risolto:

In fondo al file /etc/rc.d/rc.modules ho aggiunto le seguenti righe:
#######################################################
## ACPI MAOX X ASUS
/sbin/modprobe asus_acpi
/sbin/modprobe video
/sbin/modprobe battery
/sbin/modprobe container
/sbin/modprobe button
/sbin/modprobe ac
/sbin/modprobe thermal
/sbin/modprobe processor
/sbin/modprobe fan

/sbin/depmod -ae
###########################################################à
In queso modo è comparsa l’icona delle batterie e posso gestire il risparmio energetico.

Per i tasti funzione:
in /etc/acpi ho modificato il file acpi_handler.sh come segue:

###########################################################
root@trinity2:/etc/acpi# cat acpi_handler.sh
#!/bin/sh
# Default acpi script that takes an entry for all actions

IFS=${IFS}/
set $@

case “$1” in
button)
case “$2” in
power) /sbin/init 0
;;
*) logger “ACPI action $2 is not defined”
;;
esac
;;
hotkey)
case “$2” in
ATKD)
case “$3” in
0000005e)
logger “WIFI in Accenione…”
/etc/acpi/wifi_on.sh
logger “WIFI Acceso!”
echo “WIFI Acceso!” | wall
;;
0000005f)
logger “WIFI in Spegnimento…”
/etc/acpi/wifi_off.sh
logger “WIFI Spento!”
echo “WIFI Spento!” | wall
;;
00000032)
logger “MUTE / UNMUTE AUDIO…”
MUTE=`amixer get PCM | grep Left | grep -v Right | cut -d ” ” -f 9`
if [ $MUTE == [on] ]; then
/usr/bin/amixer set PCM mute
else
/usr/bin/amixer set PCM unmute
fi
;;
00000031)
logger “Abbasso il volume…”
amixer set PCM 2-
;;
00000030)
logger “Alzo il volume…”
amixer set PCM 2+
;;
*)
logger “AA $3 AA $4”
logger “BB $3 BB $4”
;;
esac
;;
*) logger “ACPI action $2 is not defined”
;;
esac
;;
*)
logger “ACPI group $1 / action $2 is not defined $3 AAA $4 BBBB $5 CCCC”
;;
esac
###############################################################

Con questo file riesco a controllare il volume e l’attivazione della wireless dai tasti funzione su linux.
Premendo Fn+F10 attivo o disattivo l’audio
Premendo Fn+F11 abbasso l’audio
Premendo Fn+F12 alzo l’audio

e, sempre in /etc/acpi/ ho aggiunto i seguenti file:
#################WIFI_ON############################################
root@trinity2:/etc/acpi# cat wifi_on.sh
#!/bin/bash
/sbin/ifconfig eth0 down
/sbin/modprobe ipw3945
/sbin/depmod -ae
/sbin/ipw3945d -quiet
sleep 5
/sbin/dhcpcd -d -t 15 eth1
#################################################################

#######################WIFI_OFF###############################
root@trinity2:/etc/acpi# cat wifi_off.sh
#!/bin/bash
/sbin/ifconfig eth1 down

/sbin/ipw3945d -kill
/sbin/ipw3945d -kill
killall ipw3945d

/sbin/rmmod ipw3945
/sbin/depmod -ae

/etc/rc.d/rc.inet1 restart
###############################################################

poi un bel
chmod ugo+x /etc/acpi/wifi_*

In questo modo posso attivare e disabilitare la wireless tramite la combinazione di tasti
Fn+F2

.