There was a post not that long ago, How to run a script at boot?.
Post #38 discussed how to make a systemd service that will run code on/at system startup.
Some modifications for your use case would be, to change the Wantedby=
something more appropriate such as multi-user.target
, basic.target
or maybe sysinit.target
. Also you'll want to remove After=graphical.target
, since the code your using probably won't need to wait for a service to start.
[Install]
WantedBy=multi-user.target
Another easier option would be to create a auto run/start "app". Most desktops environments (if not all) have a method to automatically launch a .desktop
file on user login. You can create a shell/bash script and have it run on login.
If you need to run the command every time your system starts (startup and resume) then you'll probably need to look into systemd specifically, otherwise it doesn't really matter which method you use as long as you login.