This project was inspired by David Levitan's
Ideas used in sonykeyd are taken from sonypid (event reading) and acpid (handling events by user configurable shell script).
As this project didn't evaluate nearly at all since its initial version (0.01 in Apr 2002), you may prefer to use something that is developed more actively, eg.
Compile recent 2.4 (2.4.7+) or 2.6 kernel. You must compile in sonypi driver.
This description assumes that sonypi is compiled as an module, but you can configure it as solid part of the kernel as well.
You will find relevant kernel option in
(Device Drivers ->) Character devices -> Sony Vaio Programmable I/O Control Device support
If your model doesn't have Jogdial button, you may need use newer kernel (2.4.19+) version as it has necessary changes.
alias char-major-10-63 sonypi options sonypi minor=63 nojogdial=1Of course if your model has Jogdial, clear "nojogdial=1" option!
# mknod /dev/sonypi c 10 63If your system (eg. Fedora Core 3) uses udev, please see docs, to find out how to make this device node permanent.
$ tar -xzf sonykeyd-0.2.tar.gzCompile it:
$ cd sonykeyd-0.2 $ makeYou may have to modify Makefile and change /usr/src/linux/include path to wherever your kernel headers are.
# make installwill simply copy sonykeyd file to /usr/local/sbin. You can do it by hand.
By default, when sonypi event is registered,
/usr/local/sbin/sonykey.sh program (script) is called.
Names of keys used are in the table (or in strings.c file in package)
Bash script sonykey.sh included in package will do the following:
Fn+F4: select global/pcm volume for changing
Fn+F5: select brightness for changing
Fn+1: decrease selected option
Fn+2: increase selected option
Fn+E: eject the cdrom
This script calls aumix program to control volume, spicctrl program to control brightness, and eject program to eject cdrom tray.
Feel free to extend or replace what the script do...
# cp scripts/sonykey.sh /usr/local/sbin # chmod 0700 /usr/local/sbin/sonykey.sh
# mkdir -p /var/local/sound/state
Press Fn+F5, and Fn+1 several times... Does the screen get darker?
Now play some music and press Fn+F4 and Fn+1. Any volume change?
What about Fn+E -- eject?
Sorry, this was tested on RedHat & Fedora Core 2 only. But should work on any system that uses config utility.
copy sonypi to /etc/rc.d/init.d and make it executable:
# cp scripts/sonypi /etc/rc.d/init.d # chmod 0755 /etc/rc.d/init.d/sonypiInstall it.
# chkconfig --add sonypi
|Jogdial Down & Pressed||jd-down-P|
|Jogdial Up & Pressed||jd-up-P|
|Capture Partial Pressed||cp-partP|
|Capture Partial Released||cp-partR|
|Bluetooth Button Pressed||p-bt|