How to autorun GUI application

Hi
I am using window on beglebone black by referring to About window on Beaglebone - #7 by taek8461
I installed Qt Creator
I built a GUI application using Qt Creator.
I want the program to run automatically after booting.

I made a shell script as below.

...
export DISPLAY=:0
nohup /home/debian/Documents/build-TIFD-Desktop-Debug/TIFD &

and I made Service file

[Unit]
Description=Enable Config
after=generic-board-startup.service

[Service]
Type=simple
ExecStart=/usr/bin/enable-config.sh

[Install]
WantedBy=multi-user.target

The gui program (TIFD) did not run automatically.
How can I make the gui program run automatically?
Please help me.

Hi @taek8461 which window manager are you using?

xfce/kde/lxqt/etc?

My goto for a simple display on these devices is thru openbox…

sudo apt update
sudo apt upgrade
sudo apt install openbox feh
echo "exec openbox-session" > /home/debian/.xsession
mkdir -p /home/debian/.config/openbox/
echo "feh --bg-scale /home/debian/<mybackground>.jpg" > /home/debian/.config/openbox/autostart
echo "/home/debian/<myqtapplication> &" >> /home/debian/.config/openbox/autostart

Now if you are using something other then openbox… Such as xfce/etc, it’ll have a different auto-start setup…

Regards,

Hi
I did as you described and it works well.
but it has some problems.

The first one is that the program menu button is missing in the lower left corner of the window, so qtcreator cannot be run.
When I close the application, only the background image is shown, or when the background image is removed, only a black screen is shown. There is no trash can and no menu list in the lower left corner.

The second one is
I disabled the screen saver before changing the setting, but after setting the screen saver works automatically.
Even if I disabled screen saver in the menu, the screen saver continues to operate.

Is there a way to solve the above two problems?
or can you let me know how to run application automatically?

I modified the /etc/lightdm/lightdm.conf file for auto login.

thank you.

Yeap, that’s openbox… You can right click on the desktop, to get a menu. Normally when i use openbox, the user will either only be able to touch elements, or show a raw display, anything outside of the “application” is not allowed…

It sounds like you still need the full desktop experience behind your app running… In that case, which windows manager would you like, each has a different auto-start…

Depending on Window Manager, the best way to disable this, is to remove the package…

The directions for this completely depend on which windows manager you are using, each is slightly different…

Regards,

My window manager is LXDE

I added some commands in the /etc/lxsession/LXDE/autostart as below

export DISPLAY=:0
/home/debian/Documents/build-TIFD-Desktop-Debug/TIFD &

image

but TIFD does not run automatically.

Help me please~
Thank you

Hi @taek8461

https://wiki.lxde.org/en/LXSession#Autostarted_applications_using_lxsession

Use the local version:

~/.config/lxsession/<profile>/autostart 

I bet your tripping on this one issue:

If both files are present, only the entries in the local file will be executed.

Regards,

1 Like

thank you for your help
I resolved it