Presumably there are some differences in the environment? between systemd and the user command line that allow the later to work.
There are. But those aren't the main problems with your service:
- multi-user.target is reached before the desktop has started. If you need the desktop use graphical.target
- You don't appear to have specified which desktop to connect to.
- A fixed length sleep is a horrible, often ineffective hack. If you're using systemd set the dependencies properly and you won't need the sleep.
For more and alternatives see Running A Program At Start Up A Beginner's Guide (full disclosure: I wrote that guide)
Statistics: Posted by thagrol — Fri Apr 19, 2024 11:26 pm