I'm trying to run Qt GUI application automatically when booting Raspberry Pi using Openbox but have problems and can't make it work. Steps I did:
. /etc/X11/Xsessionand added
/home/pi/Wt/WidgTest &which is my app.
OpenBox runs because I have black screen with cursor in it and can access it's menus but my application doesn't. Can someone tell me what I do wrong?
As suggested in the comments I tried to used systemd unit files to do this. First I made an unit file for xsession:
[Unit] Description=session [Service] Type=idle ExecStart=startx [Install] WantedBy=multi-user.target
Then I made the unit file to run openbox session:
[Unit] Description=Openbox After=session.service [Service] Type=idle ExecStart=/usr/bin/openbox-session [Install] WantedBy=multi-user.target
And unit file to run my app:
[Unit] Description=MyApp After=openbox.service [Service] Type=idle ExecStart=/home/pi/Desktop/MyApp/MyApp [Install] WantedBy=multi-user.target
The openbox service fails to run.
systemctl status openbox.session output:
openbox.service - Openbox Loaded: loaded (/lib/systemd/system/openbox.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Tue 2020-12-08 06:52:56 GMT; 46s ago Process: 415 ExecStart=/usr/bin/openbox-session (code=exited, status=1/FAILURE) Main PID: 415 (code=exited, status=1/FAILURE) Dec 08 06:52:51 raspberrypi systemd: Started Openbox. Dec 08 06:52:56 raspberrypi openbox-session: Openbox-Message: Failed to open the display from the DISPLAY environment variable. Dec 08 06:52:56 raspberrypi systemd: openbox.service: Main process exited, code=exited, status=1/FAILURE Dec 08 06:52:56 raspberrypi systemd: openbox.service: Failed with result 'exit-code'.
UPDATE with info from a comment:
I'm trying to do is to boot raspberry to my app. I want to display my splashscreen and then run my app. So I switched boot to Console Autologin and try to run Openbox just for my application. At first I tried to do that by running my app directly in the framebuffer, but I had problem with rotating my app and displaying gradients so I'm looking for another alternative.