HARDWARE Logitech G15
From Gentoo Linux Wiki
Contents |
[edit] Media Keys
The media keys on the keyboard is supported natively in Gnome and KDE. The G15 daemon must be installed and running. As a subsequent dependency uinput must also be supported in your running kernel.
[edit] KDE
The simplest way for them to be used by your programs is to put the following keycodes in ~/.Xmodmap
keycode 176 = XF86AudioRaiseVolume keycode 174 = XF86AudioLowerVolume keycode 160 = XF86AudioMute keycode 162 = XF86AudioPlay keycode 144 = XF86AudioPrev keycode 153 = XF86AudioNext keycode 164 = XF86AudioStop
Enter these changes by typing xmodmap ~/.Xmodmap
Several G15 keyboards have been compared and all resulted in the same keycodes. To verify or debug any problems xev maybe used to find the codes.
Hotkeys may then be entered by going to Control Center --> Regional & Accessibility --> Input Actions or Keyboard Shortcuts. To control other KDE applications Input Actions and using DCOP actions is the simplest method.
[edit] Lineakd
Alternatively, if you're not using Gnome, lineakd can be used to control media applications with the media keys on the G15:
To install:
emerge lineakd
If you want to use lineakd to control more than one media application, such as xmms or MPD, you will want to install media-detect.
You will need to configure lineakd to be run when X starts, such as in .xinitrc
~/.lineak/lineak.conf needs to be configured:
[edit] G Keys
Although many methods probably exist to implement these, one possible method is through the use of xbindkeys and xvkbd. The g15 daemon must be installed and running, as per prior sections.
First, install the two apps
emerge -av xbindkeys xvkbd
Then the keys being pressed can be identified by running:
xbindkeys -mk
The output of this can be used directly in ~/.xbindkeysrc. For each key, three lines will be given. The first line should be edited to be the command you wish.
If you wish that command to be a series of keys, then xvkbd must be used. For each key make a shell script that calls xvkbd. An example of this would be, for the macro shell script:
#!/bin/bash sleep 0.1 xvkbd -text i xvkbd -text f xvkbd -text " "
A short sleep does appear to be necessary for the key to work in all programs. The relevant ~/.xbindkeysrc entry would be:
##macro g2 "/home/kreton/.macros/g2.sh &" m:0x10 + c:152 Mod2 + NoSymbol
The bottom two lines were, again, obtained from xbindkeys -mk output and may vary with your keyboard.
As a warning, G1 appears to be reserved and used solely for accessing the options menu of the LCD when using lcdproc and may be also true if only g15composer and/or g15daemon are used.
[edit] LCD Keys
[edit] lcdproc
With g15daemon, g15composer, and lcdproc running the lcd keys appear to just work. G1 functionally becomes the option menu of lcdproc. MR is used to cycle through the available g15daemon/g15composer created screens. The round lcd button is used to rotate and pause at the current screen in lcdproc. The remaining 4 lcd buttons, from left to right, are for left, up, down, and right.
[edit] LCD
[edit] g15composer
g15compser allows for simple usage of the lcd device through a pipe found at /var/run/g15composer. Text sent through a pipe to this file will be displayed on the lcd. Each new pipe sending data to /var/run/g15composer will create a new screen that can be cycled using the MR key.
g15 composer is part of g15tools.
To install:
echo "dev-libs/libg15" >> /etc/portage/package.keywords echo "app-misc/g15daemon" >> /etc/portage/package.keywords echo "dev-libs/libg15render" >> /etc/portage/package.keywords echo "app-misc/g15composer" >> /etc/portage/package.keywords emerge -va libg15 g15daemon libg15render g15composer [ebuild R ] dev-libs/libg15-1.2.1 0 kB [ebuild R ] app-misc/g15daemon-1.2.6a-r1 USE="perl python" 0 kB [ebuild R ] dev-libs/libg15render-1.2 USE="truetype" 0 kB [ebuild R ] app-misc/g15composer-3.1 USE="amarok -examples truetype" 0 kB rc-update add g15daemon default rc-update add g15composer default
Before we can start g15composer, we need to enter a user who will run the FIFO controls. So we will need to edit /etc/conf.d/g15composer before we can start g15composer.
# As this is also the user as whom g15composer is run, # it has to be someone who can create further message channels # This should be the user who runs the LCD clients FIFO_USER=yourusername FIFO_GROUP=users
Start it with:
/etc/init.d/g15daemon start /etc/init.d/g15composer start
If you enabled the amarok USE flag on g15composer, you will have a new script called "g15-display.pl" in the script manager in the "General" folder.
[edit] lcdproc
Newer versions of lcdproc have basic support for the Logitech G15's LCD Display using g15daemon. To use lcdproc with the G15, enable the g15 expanded useflag by adding the following to /etc/make.conf:
LCD_DEVICES="g15"
You can install lcdproc with:
echo "app-misc/lcdproc" >> /etc/portage/package.keywords (no longer needed) emerge lcdproc rc-update add LCDd default rc-update add lcdproc default
To configure lcdproc to use the g15 driver, edit /etc/LCDd.conf and change driver=ncurses to driver=g15
And start it with:
/etc/init.d/LCDd start /etc/init.d/lcdproc start
You might also want to enable the lcd USE flag so programs such as mythtv are compiled with lcdproc support.
euse --enable lcd
[edit] lcd4linux
lcd4linux has a g15 driver however its fairly new.
[edit] graphlcd
Graphlcd also has support for the g15 when the g15 USE flag is enabled.
[edit] XMMS plugin
There is a xmms plugin in the SVN trunk of g15daemon. Obviously it need g15daemon running. To install:
svn co https://g15daemon.svn.sourceforge.net/svnroot/g15daemon/trunk/g15daemon-audio-plugins/g15daemon_xmms g15daemon_xmms cd g15daemon_xmms ./autogen.sh && ./configure && make make install (as root)
[edit] Audacious plugin
There is an Audacious plugin in the SVN trunk of g15daemon. Obviously it need g15daemon running. To install:
svn co https://g15daemon.svn.sourceforge.net/svnroot/g15daemon/trunk/g15daemon-audio-plugins/g15daemon_audacious g15daemon_audacious cd g15daemon_audacious ./autogen.sh && ./configure && make make install (as root)
[edit] Troubleshooting
If you installed g15tools and started g15daemon as explained above you should get a splash screen and a clock (minimum if it is working).
[edit] Step 1
If you see nothing at all, check for the g15composer pipe:
ls -la /var/run/*g15*
You should see some pid files if the daemon is running and the g15composer pipe should belong to the right user (the other files should belong to root). Note that these files are generated so 'chown' on them is a bad idea as it will only last between restarts of the daemons. If the pipe does not belong to you (or at least you cannot access it as your user), check the files in '/etc/conf.d/g15*' again for proper settings.
[edit] Step 2
Stop the daemons:
/etc/init.d/g15composer stop
This should also stop the g15daemon program. Now start it as root:
g15daemon -d
You will now exactly see what the daemon is doing while starting up. It should like something like this when it is working:
usb_set_debug: Setting debugging level to 1 (on) usb_os_init: Found USB VFS at /dev/bus/usb skipping descriptor 0x25 skipping descriptor 0x25 libg15: Found 1 supported devices libg15: Trying to find Logitech G15 libg15: Found Logitech G15, trying to open it libg15: Device has 1 possible configurations libg15: Device has 1 Alternate Settings libg15: Interface 0 has 2 Endpoints libg15: Found "Extra Keys" endpoint 1 with address 0x81 maxtransfersize=32 libg15: Found "LCD" endpoint 2 with address 0x2 maxtransfersize=32 libg15: Done opening the keyboard
If you see something like this:
... libg15: Found "LCD" endpoint 2 with address 0x2 maxtransfersize=32 libg15: Done opening the keyboard libg15: usb error: ENOSPC.. reducing speed libg15: usb error: ENOSPC.. reducing speed g15daemon 1.2.7 loaded
The daemon might load properly but the LCD will *NOT* work. This is usually the case when there is too little bandwidth (thats what ENOSPC means). The daemon attempts to throttle it down but it will probably fail if you are reading this.
Try an alternative port on your PC. If you are using an USB hub, try plugging the keyboard directly into your PC. If you need the hub because you used all ports, try replugging everything so devices that need high speeds (scanner, printer, lcd keyboard) are directly connected. Stuff like USB sticks, PDA cradles can do their job fine on a hub.
If you can't get it to work or can't hook up everything at once, think about buying a seperate USB controller to get more native USB connections.
