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
[Unit]
Description=Logitech led service
[Service]
ExecStart=sudo /home/$USER/Documents/g203-led/leds-start
[Install]
WantedBy=multi-user.target, wakeup.target
Sh file
#!/bin/bash
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
[Unit]
Description=Logitech led service
After=basic.target suspend.target hibernate.target
[Service]
User=Root
ExecStart=/home/&USER/Documents/g203-led/leds-start
[Install]
WantedBy=multi-user.target basic.target suspend.target hibernate.target