简体   繁体   中英

How can I auto start a python/pyside GUI

I created a Pyside QT GUI app (Python 2.7) and part of the spec is to launch it automatically when the system starts. Normal init.d stuff doesn't seem to work since it's a GUI app.

So far I've tried x11 init.d and xdg xyz.desktop solutions and they don't seem to work.

How would you solve this?

How are Pyside apps auto started on system boot?

(Debian Wheezy)

It is actually strange that init.d didn't work. You can also try to add a command into /etc/rc.local Some details are here: https://unix.stackexchange.com/a/49635

The script /etc/rc.local is for use by the system administrator. It is executed after all the normal system services are started, at the end of the process of switching to a multiuser runlevel. You might use it to start a custom service, for example a server that's installed in /usr/local.

Ok after hours and hours of fooling around I figured it out. I actually used the built-in startup manager in GNOME. I tried this before but it didn't work. So this time I created an entry to start gnome-calculator.. the built in calculator.

Then I edited the entry in ~/.config/autostart/gnome-calculator.desktop using gedit (gedit ~/.config/autostart/gnome-calculator.desktop). I changed Exec=gnome-calculator to Exec=python /home/me/myapp.py

and it works.

Yes it is a lame solution and it doesn't identify what the problem was but it's a start. Thanks for the help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM