ajgiampa
Posts: 6
Joined: Fri Jun 07, 2013 2:32 pm

Application starts in the wrong Xwindow session

Mon Jul 08, 2013 2:15 am

I setup the raspberry pi to automatically load the GUI after bootup. I did this by adding "startx" to the /etc/rc.local file. I then created an autostart file in ~/.config/autostart to run a slideshow script. Everything works great, except the slideshow doesn't appear on the monitor I have hooked up to the Raspberry Pi. I only see it when I log into the Pi via TightVNCViewer on display :1. Why is it defaulting to this display instance and not the monitor, which I assume is display :0?

Thanks...

User avatar
Davespice
Raspberry Pi Foundation Employee & Forum Moderator
Raspberry Pi Foundation Employee & Forum Moderator
Posts: 1603
Joined: Fri Oct 14, 2011 8:06 pm
Location: London, United Kingdom
Contact: Website Twitter

Re: Application starts in the wrong Xwindow session

Mon Jul 08, 2013 10:48 am

I was just wondering, do you also automatically start a vnc server on this Pi at boot time?
If so you might find it’ll work as expected if you don’t start the vnc server until after you’ve started your slide show process.

User avatar
topguy
Posts: 3438
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Application starts in the wrong Xwindow session

Mon Jul 08, 2013 11:04 am

The script that starts your slideshow should explicitly set the DISPLAY variable to the correct screen before starting the slideshow.

Code: Select all

export DISPLAY=:0.0

User avatar
jojopi
Posts: 2992
Joined: Tue Oct 11, 2011 8:38 pm

Re: Application starts in the wrong Xwindow session

Mon Jul 08, 2013 11:12 am

ajgiampa wrote:I did this by adding "startx" to the /etc/rc.local file.
That is running startx as root, which is already a bad idea, and it is no surprise that it ignores /home/pi/.config. Putting long-running jobs in rc.local also delays the boot sequence, which may prevent text-mode logins (getty) from starting.

The correct way to start a GUI at boot time is to enable a display manager. In the Foundation's Raspbian images, raspi-config has an option to do this.

Return to “Troubleshooting”

Who is online

Users browsing this forum: Bing [Bot] and 50 guests