Salut.
ATTENTION. C'est pour un portable Sony Vaio !!!
1. Tu récupères et installes smartdimmer
http://www.acc.umu.se/~erikw/program/smartdimmer-0.1.tar.bz2 :
# ./configure
# make
# make install
2. Tu récupères sonypid :
http://www.popies.net/sonypi/sonypid-1.9.1.tar.bz2
sonypid te permet d'intercepter les touches Fn. Il faut modifier le source pour appeler smartdimmer pour régler la luminosité.
J'ai rajouté ligne 235 :
system("smartdimmer -d");
J'ai rajouté ligne 238 :
system("smartdimmer -i");
soit :
case SONYPI_EVENT_FNKEY_F5:
verboseEvent("Fn-F5 Pressed");
system("smartdimmer -d");
break;
case SONYPI_EVENT_FNKEY_F6:
verboseEvent("Fn-F6 Pressed");
system("smartdimmer -i");
break;
puis :
# ./configure
# make
# make install
3. Tu crées le shell script /etc/init.d/sony contenant :
#!/bin/sh
#
. /etc/init.d/functions
umask 077
export PATH=/usr/local/bin:$PATH
exec=/usr/local/bin/sonypid
prog=$(basename $exec)
# Source config
start() {
echo -n $"Starting SONY: "
/bin/mknod /dev/sonypi c 10 250 1>/dev/null 2>/dev/null
daemon $prog -D
retval=$?
echo
[ $retval -eq 0 ]
return $retval
}
stop() {
echo -n $"Stopping SONY: "
killproc $prog
retval=$?
echo
[ $retval -eq 0 ]
return $retval
}
restart() {
stop
start
}
case "$1" in
start|stop|restart)
$1
;;
reload|force-reload)
restart
;;
status)
status $prog
;;
condrestart|try-restart)
[ ! -f $lockfile ] || restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|try-restart|reload|force-reload}"
exit 2
esac
4. Tu mets les droits corrects :
# chmod a+x /etc/init.d/sony
5. Tu testes :
# /etc/init.d/sony start
Les touches Fn doivent marcher pour la luminosité.
Si c'est OK, tu rajoutes le lancement du service pour le niveau 5.
# ln -s /etc/init.d/sony /etc/rc5.d/S99sony
++