Sidewinderd

This is a quick-and-dirty way to make the macro keys on the Logitech G105 keyboard usable on an OpenRC Gentoo system. Perhaps it can be used on a systemd box as well. Please feel free to improve, it should be possible to turn all this into a well-behaved ebuild.

Attach your Logitech G105 keyboard to your Gentoo box. You should see a filesystem object such as this one:

/dev/input/by-id/usb-Logitech_Gaming_Keyboard_G105-event-kbd

If not present, try rebooting. If that does not help then maybe the kernel needs to be reconfigured (TBD: how?).

Become root and create a source directory somewhere:

mkdir -p /opt/local/src/sidewinder cd /opt/local/src/sidewinder

Download and unpack the "sidewinderd" software from GitHub:

wget https://github.com/tolga9009/sidewinderd/archive/master.zip unzip master.zip cd sidewinderd-master

Emerge required dependencies (if not already present):

emerge cmake libconfig tinyxml2

The following edit seems to be necessary:

sed -i -e s:/dev/input/uinput:/dev/input/by-id/usb-Logitech_Gaming_Keyboard_G105-event-kbd: src/core/virtual_input.cpp

Build and install sidewinderd (warning: this is a dirty step since proper Portage tools are not being used):

mkdir build cd build cmake .. make mkdir -p /usr/local/lib/systemd/system make install

Edit the configuration file (replace MYUSERNAME with your login name)

sed -i -e '/user = /s:root:MYUSERNAME:' /etc/sidewinderd.conf

Start the daemon:

/usr/local/bin/sidewinderd

If all went well you should now be able to use the MR, M1, M2, M3 and G1 through G6 keys. To record a macro for G1 press MR, G1, the wanted key sequence, and MR again. Three separate sets of definitions can be switched between using the M1, M2, M3 keys.

Macros are recorded with delays by default. To get fast playback change the capture_delays setting to false in the configuration file. Using capture_delays = false may not be fully robust however.

To have sidewinderd start at bootup add some simple scripts to /etc/local.d:

cd /etc/local.d echo "sidewinderd -d" >sidewinderd.start echo "pkill sidewinderd" >sidewinderd.stop chmod +x sidewinderd.start sidewinderd.stop

Uninstalling can be done manually by removing /etc/local.d/sidewinderd.*, /usr/local/bin/sidewinderd, /etc/sidewinderd.conf and /usr/local/lib/systemd/system/sidewinderd.service.