Running X on a Logitech G19 LCD

The Logitech G19 keyboard is Article description::a gaming keyboard that has extra keys and a built-in LCD color display. Its display is small and its resolution is rather low (320x240 pixels), but it's enough to do a lot of useful and cool things, considering it's connected with USB 2.0.

The following instructions describe the installation of the kernel driver and the setup of a secondary X server. While it should be possible to use an existing X server to handle the G19 LCD in addition to standard screen(s), there are advantages on using a separate X server. For example, a user can start/stop/restart the G19 X while your main X is running.

Kernel Preparation
The official linux kernel does not have support for the G19 yet. However, a working driver is available from github:

But before installing it make sure the kernel has CONFIG_FB_DEFERRED_IO set. If it is already set, this part can be skipped.

There isn't a way to directly set this from the kernel menuconfig, but it can be enabling by something that selects it:

Please note this driver isn't really needed, it's just a hackish way to select CONFIG_FB_DEFERRED_IO through menuconfig. If a better way is known, please add it here.

Now, compile the new kernel image and install it. Making just the modules isn't enough as CONFIG_FB_DEFERRED_IO option changed. Don't reboot yet.

Installing the lg4l driver
If CONFIG_FB_DEFERRED_IO is not set as described above, there will be an error while compiling. If everything is OK, move on.

Installing fbdev
is required to run X later:

You may now reboot.

After rebooting
As per the lg4l README:

but the device will still be grabbed by the generic driver. Running:

located in the lg4l source tree to put the new module in control of the device (consider automating this).

Secondary X server
The following method is based on the DisplayLink wiki page. In it, it says you need to make it work but I haven't installed it and it all works fine. If it doesn't work, follow the instructions on the DisplayLink page.

To switch keyboard/mouse focus to the LCD screen, you will need x2x. Expert users who plan to just open apps in the G19 LCD won't need x2x.

xorg.conf.g19
Create this file in /etc/X11/ and name it xorg.conf.g19:

.xinitrc2
Next create the ~/.initrc2 for the G19 display. Create and customize the file as needed, here is an example:

Please note the commands there will only affect the G19 display, not the main X.

g19lcd.sh
This is the actual script that starts the second instance of xorg-server. Make it executable and save it somewhere accessible: