I'm synchronizing my keyboard leds to cycle color with my mouse this way: cd /home/&USER/Docuemnts/g203-led; sudo g213-led -fx cycle all 20000ms && sudo ./g203-led.py cycle 20000;

here there are instructions to set a service: How do I run a single command at startup using systemd?

Github to g203-led: https://github.com/smasty/g203-led

I want to setup a service that run at startup and on wake. But the problem I have is that the g203-led is not part of Ubuntu software. I don't know if I should do cd path/to/script in a service or if there are better ways to set this up.

I guess the service would look like this but I don't see targets for wake-up from suspend.

Service file

Description=Logitech led service

ExecStart=sudo /home/$USER/Documents/g203-led/leds-start

WantedBy=multi-user.target, wakeup.target

Sh file

cd /home/&USER/Documents/g203-led;
g213-led -fx cycle all 20000ms && /home/$USER/Documents/g203-led/g203-led.py cycle 20000;

Found this: Run a command as su after every wake from suspend

So my last question would if someone can help set it up in a more clean manner if possible because I think being it on Home folder it is delaying it and making the keyboard and mouse not sync properly. Autostart works fine but it won't work on wake from suspend. I know g203-led is out of Ubuntu repos but if someone is kind to help me anyways.

Current service file

Description=Logitech led service
After=basic.target suspend.target hibernate.target

WantedBy=multi-user.target basic.target suspend.target hibernate.target

You can configure the Logitech G203 Lightsync mouse with the following (20.04):

Install ratbagd (system daemon to introspect and modify configurable mice):

sudo apt install ratbagd 

Install Piper:

 flatpak install flathub org.freedesktop.Piper

Add the missing mouse id to /usr/share/libratbag/logitech-g102-g203.device


Restart ratbagd

sudo systemctl restart ratbagd.service 

Run Piper, and I was able to set resolution, buttons and RGB effects.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.