I cannot figure out how to autostart a GUI application as the logged in user on the current Raspberry OS Full (Bookworm, 64-bit). I tried via systemd, but for some reason it fails, the error is as if the desktop environment is not fully initialized yet.
[Unit]
Description=My Autorun Service
After=graphical-session.target
[Service]
ExecStart=/home/pi/start_my_app.sh
WorkingDirectory=/home/pi/
Restart=always
RestartSec=2s
User=pi
[Install]
WantedBy=default.target
What are other possible way? Any better ways? Or is there anything wrong with my .service file?
for some reasonwhat reason,the error iswhat exactly? not your interpretation, what is the error?graphical-session.targetshould work, according to all descriptions, it's made just for this. And yet it doesn't work.systemctl --user enableas user Pi.