On Wednesday, 18 April 2018 00:01:35 MDT Pierre Ossman wrote:
> On 15/04/18 21:50, 3be...@gmail.com wrote:
> > I am trying to get vncserver to run some commands when it starts up. If I
> > create a ~/.xsession file, the vncserver command fails (even if .xsession
> > is empty) but any commands in .xsession run. If I create a
> > ~/.vnc/xstartup file, vncserver declares success and the commands in
> > xstartup run, but I get a black screen when I connect with a viewer. I
> > am on the latest Raspbian. Any suggestions?
> How exactly does your startup file look? Those files you've named is the
> only thing that will be executed for your session, not just extra
> commands. So if you don't have a desktop environment in there then
> you'll just get a black screen.
I already had an autostart in ~/.config/lxsessions/LXDE-pi/ that was doing a perfectly fine job of starting the session, so I figured that ~/.vnc/xstartup should contain the one additional program I want to autostart when vncserver runs. I understand from your reply that if ~/.vnc/xstartup exists, then autostart is not run, so I need to duplicate the commands in autostart in xstartup. Doing so almost works: I am not getting the black screen anymore. However, my application appears to be mostly offscreen below and to the right of the bottom right corner and its window lacks decoration. Also, I don't get a pointer until I open a terminal window, at which point I get the X pointer.
Here's what I have in xstartup now:
lxpanel --profile LXDE-pi
pcmanfm --desktop --profile LXDE-pi
xscreensaver -no-splash
point-rpi
<my_app>
I lifted the first 4 lines from autostart.