automatically starting GUI program on startx

1

I have GUI code written in PyQt in main.py that I want to start up automatically after startx starts.

I've already configured my beaglebone (Debian) to run startx on power up.

I initially included the following in/etc/x11/xinitrc: @/usr/bin/python3 /root/PyQt/main.py

This worked perfectly until I deleted some files from /root to create space on my beaglebone. I'm not sure what exactly I deleted (mostly log files) but I might have also deleted the .XAuthority, .bash_profile, .config folder, .dbus folder.

Ever since then, it hasn't been autostarting my main.py on boot. Even now, after new .XAuthority,.bash_profile, etc have been created, it still isn't auto-starting my program.

Is there a way to fix this? Or another way to autostartmain.py?

Note: I'm running Debian on my beaglebone and lxqt.

avelampudi

Posted 2016-12-14T15:42:37.453

Reputation: 11

Answers

0

You can add the following line to ~/.xsession:

/usr/bin/python3 /root/PyQt/main.py&

(note the final &) before the last line.

Or you can rely on your window manager to start it up for you.

Alessandro Dotti Contra

Posted 2016-12-14T15:42:37.453

Reputation: 434

I tried adding it to xsession already, and it doesn't work. How would i get the window manager to set it up for me? – avelampudi – 2016-12-15T16:14:18.037

It really depends on your window manager. Can you tell us which one are you using? – Alessandro Dotti Contra – 2016-12-16T15:15:05.217

-2

step 1: edit file /etc/systemd/system/gogs_webhook.service

file content

[Unit]

Description= your description (here Service) After=syslog.target After=network.target

[Service] Type=simple User=gogs Group=gogs WorkingDirectory=/root ExecStart=/usr/bin/python3 /root/PyQt/main.py Environment=USER=gogs HOME=/home/gogs TimeoutStartSec=5 Restart=on-failure RestartSec=5 RemainAfterExit=yes

[Install] WantedBy=multi-user.target


step 2: sudo systemctl daemon-reload

step 3: sudo systemctl enable youselfservice.service

setp 4 : OK,then to reboot your PC or sudo systemctl start youselfservice.service

user5519192

Posted 2016-12-14T15:42:37.453

Reputation: 1

1could you explain how/why this would work? – avelampudi – 2016-12-15T16:11:21.500