20 October, 2023

Logitech G815 Keyboard

The first impression was: oh no a teenager programmed the default cycling colors. It was most annoying, just to say it in a civil manner. A keyboard is a working tool not a lightshow. A tool should help, not distract. 

However, I found this Gist: https://gist.github.com/cornernote/a0d1893aa004b8928ec7e94ccd8dd844 

This recipe works on Ubuntu:

Install

sudo apt install -y libhidapi-dev
git clone https://github.com/MatMoul/g810-led.git
cd g810-led
make clean
make bin
sudo make install

Sample Settings

# red
sudo g815-led -dv 046d -dp c33f -tuk 1 -a FF0000
# green
sudo g815-led -dv 046d -dp c33f -tuk 1 -a 00FF00
# blue
sudo g815-led -dv 046d -dp c33f -tuk 1 -a 0000FF

I used the green one as a starting point. Thanx to the developers behind this repo :-) 

How to initiate a keyboard script at boot

The Script

Here is the script, that I've saved as /etc/init.d/keyboard.zsh

#!/bin/zsh
# Keyboard setup at boot
# Logitech G815
# Date: 20231020
g815-led -a ffaa00

If you use bash, the shebang (i.e. the first line of this script) should be: 

#!/bin/bash

Now make the script executable:

chmod a+x /etc/init.d/keyboard.zsh

Execute at startup

The last step is to run the script when the system boots. So:

update-rc.d /etc/init.d/keyboard.zsh defaults

The defaults keyword will run the script per default.

Now the keyboard will have a warm curry color. You can change the color, and get the hexcode for the color by a color picker. The one on Duckduckgo is excellent: https://duckduckgo.com/?q=color+picker&atb=v314-1&ia=answer 

Impression of the Logitech G815

It's a fine keyboard. However the annoying color cycles are stupid. Most of us want a more silent working experience. To this moment I don't get the idea of the G-function buttons. They are next to SHIFT, and this will give a lot of weird misses, like this: 5 4444444444444444448 - yeah this was the kind of accident. Obviously Logitech should have tested the UX of the keyboard on a few users above the teenage segment.

That being said, the feeling of the keyboard is great. I like the click of the buttons. And I like the fact that it is programmable by Linux users - that is if they are not afraid of scripts here and there.

At cold boot the script was NOT executed

In this AskUbuntu thread I found a working solution:

Running crontab -e will allow you to edit your cron.
Adding a line like this to it:

@reboot /path/to/script
will execute that script once your computer boots up.
So I added this to the crontab:

@reboot /etc/init.d/keyboard.zsh

This solution works on my Ubuntu Ubuntu 23.04 x86_64 6.2.0-35-generic system. 

Now I'd like to program the G-keys and the M-keys. 


No comments: