Eject Key, Apple Pro Keyboard, and Linux

One thing I never liked about running Linux on my iMac is the fact that the eject key doesn’t work.
Using Debian, Gnome 2.8, Linux 2.6.8.

Well the problem is now solved, or fixed, thanks to a bit of scripting and the eject executable.

I wrote a little PHP script:

if (!file_exists('/tmp/maccd')) {
$stat = 'closed';
else {
$stat = 'open';

if ($stat == 'closed') {
$hd = fopen('/tmp/maccd', 'w');
else {
system('/usr/bin/eject -t');

And put it in /usr/local/bin/maccd
Added a shortcut icon into the Gnome panel, and know all I have to do is click a button to eject and close my cd tray.
At least it’s easier than going to the Terminal.

Now if only I can somehow map the eject key to it…