h1

The Logitech G15 keyboard under Debian

August 19, 2007

So my MAIN MAN Ry-Guy got me a Logitech G15 keyboard for my birthday. I haven’t really checked up on keyboards lately, but this one seems pretty damn sweet. It’s got 21 or so programmable keys, audio control keys, a volume wheel, a fairly large LCD screen with a nice medium resolution that shows quite a bit, three macro configuration states, two USB ports, and all the keys are backlit blue.

Totally sweet, but of course the drivers that come with it are Windows only. Luckily I found some software on the net to drive this thing under Linux.

As of today I haven’t gotten it totally working, but I’ll update this page as I do. So far I have the following:

  1. Works as a keyboard (pretty necessary)
  2. I can map the extended keys over to built in functions, like opening a web browser, volume/play/stop, etc
  3. I can drive the LCD and have the built in time application working so it displays the time on the LCD
  4. I have g15composer working, so I can successfully send commands to display text/graphics via scripts or anything else I want.
  5. I have lcdproc working via the g15 driver, which shows cpu/memory/network/other info on the screen. LCD buttons work great to flip between each screen or lock onto one screen.

Things left to do:

  1. Add quickkeys to Gnome so I can map any key combination I want to a programmable button, not just built in functions. E.g. G11 -> alt+x or something.
  2. Get the XMMS plugin working so it displays mp3 info on the LCD screen. It’s almost there, it starts to show volume and track information and then freezes xmms up.

This is what I did to get it working. Please note, some of the steps might be unnecessary and I’ll mark them as such, I was rushing to get this up ASAP and didn’t do proper testing at each step.

1. Visit the G15 tools webpage and download both the daemon and all the libs and any plugins you want. http://g15tools.sourceforge.net/ One thing though – for some reason I couldn’t get g15composer to run from compiled source. It would compile great, but seg fault when I actually went to run it. I didn’t investigate too much, I ended up finding a package for it from the Ubuntu forums and that worked great. Here is the thread: http://ubuntuforums.org/showpost.php?p=2461304&postcount=285

2. Compile and install libg15 first. Its the low level library that communicates with the keyboard via the uinput module. PS – make sure you have the uinput module for your kernel. You may have to modprobe it, it wasn’t already loaded for me. After libg15, compile and install the g15daemon, which is the daemon that communicates with the library. Then you come compile and install libg15render, then the composer (from the package if necessary). Don’t compile and install g15lcd, its deprecated by render/composer.

3. At this point, you’ve got all your lowlevel stuff ready to go. Add g15daemon to a init.d startup script, I put mine in my gdm script but it would probably be better to make its own, since the daemon has commands to kill it, or kill it and turn off the backlight, different stuff. Its up to you how much you want to do.

4. If you look inside the contrib folder of the g15daemon install, you’ll see a keymap file in there that you’ll want to copy over to your gnome keymap to use. Copy it into .Xmodmap in your home folder – you probably won’t have that file already unless you’ve done previous mapping, so just create it. Reload GDM and you should get a little dialog asking you if you want to use the .Xmodmap file. Load it and say yes.

5. There is also a patch inside the contrib directory to be run against your X keyboard list. Now, this errored out for me on a couple of the files, so I’m not sure this is necessary, I should have checked before and after to see if it made a difference. However, regardless, you should see “Logitech G15 keyboard support via G15Daemon” as an option under “Keyboard” preferences in Gnome. I manually changed it in my xorg.conf file, but you can do it from Gnome as well.

6. Now you can go to the “Keyboard Shortcuts” preference dialog and set up system function shortcuts, like web browser, email, volume, etc. To get Play/Stop/Next/Previous working for audio controls, I had to UNMAP those shortcuts, or else they were in use when XMMS tried to map to them. This may be different for your setup, especially if you use a different audio program.

7. Install the xmms-xf86audio package, it will read in those audio key bindings once enabled. Now you can play/stop/forward/back xmms. Volume and mute worked for me out of the box regardless of any plugins.

8. Download and install the xmms plugin to use the LCD panel off the g15 website. Make sure you have the xmms-dev package installed, or it will error out while compiling (they should have checked for it during the config step, but oh well). You can enable the plugin, but for me this locks up xmms.

9. Try testing out the composer – it works from reading a pipe for commands. You can run multiple instances all working off different pipes and switch between them using the MR key, which is great for connecting your different applications to a pipe. Anyway, create your pipe with “mknod lcdpipe p” or whatever you want to call it. Then run “g15composer lcdpipe ” and you should notice your LCD display the g15composer logo. You can then echo commands to that pipe. You can find complete reference in the g15composer man page, but a quick test is echo ‘TL “Hello” “World”‘ > lcdpipe. TL is large text, and each set of quotes will go on its own line.

10. After getting that working, download and install the lcdproc program. I had to compile and install it as the Debian package didn’t have the g15 built in by default. I suppose you could get the driver and still use the package, its up to you. Anyway, if you compile, remember to include the configure command to include the g15 driver. Then edit your LCDd.conf file and set the driver to “g15″, and point it to the right driver path (in the config file as well). Then put it into an init.d startup script and run it, and you should see a message on your LCD about LCD clients. At this point you can run lcdproc and see all your cpu/memory stats.

11. Thats about it for now, the XMMS plugin still locks up unfortunately, no idea why yet. There is a package for g15 macros as well, but it requires the new version of g15daemon which wasn’t running properly on my machine. A project for another weekend perhaps.

More on all this soon hopefully!

3 comments

  1. god this was a fascinating read.


  2. Hi there

    Nice keyboard eh? :) I’d appreciate your feedback regarding problems you had with g15daemon 1.9pre, so I can resolve them in the next release. The XMMS plugin only works correctly under the new version unfortunately :(

    g15daemon packages are now available in the debian “unstable” repository, although I’m uncertain as to exactly which version.
    Cheers
    Mike


  3. Hi,
    Thanks for this, been a lot of help. I’ve got stuck on #10 however where you say ‘point it to the right driver path.’ I’m not sure where that should be going? I’ve found the line to edit in the LCDd.conf file but where exactly are the g15 drivers normally located?
    Any help would be appreciated.
    Thanks.



Leave a Comment