Page 1 of 1

start gui auto

Posted: Wed May 15, 2013 1:39 am
by aijam
I hope rpi starts up a tkinter gui program auto after rpi boot.

If I run this file.py in console.
_tkinter.TclError: no display name and no $DISPLAY environment variable

But I don't wanna startx or starlxde because of the performance of rpi.

I have tested Java 8 preview for ARM hf.
And jar can run in console.

Re: start gui auto

Posted: Wed May 15, 2013 7:31 am
by mrpi64
i think if you turn the file into an executable, and then change the last line(I THINK) in '/etc/profile' (AKA: put in the command ./script-name), it might work.

turn the file into executable by:

chmod -x script-name.py

then edit the profile file using:
sudo nano /etc/profile

hope this helps:
mrpi64

Re: start gui auto

Posted: Wed May 15, 2013 8:07 am
by rurwin
So far as I can Google, Tk requires an X server to be running. There is no implementation of Tk for a simple framebuffer such as the text console. It is possible to strip down your X session to the bare minimum -- no desktop manager, maybe no window manager (or maybe use something truly tiny such as twm.) But you will still need startx.

Re: start gui auto

Posted: Wed May 15, 2013 9:09 am
by DaveDriesen
Thanks -- just a note on the following:
turn the file into executable by:
chmod -x script-name.py
To make your file executable you would need chmod +x
(chmod -x turns the executable bit off, not on) :)

Also you can research /etc/rc.local for starting stuff at boot

Dave Driesen
Linux dev and oldskool elite

Re: start gui auto

Posted: Thu May 16, 2013 2:21 pm
by aijam
rurwin wrote:So far as I can Google, Tk requires an X server to be running. There is no implementation of Tk for a simple framebuffer such as the text console. It is possible to strip down your X session to the bare minimum -- no desktop manager, maybe no window manager (or maybe use something truly tiny such as twm.) But you will still need startx.
I installed twm and add a .xinitrc under home directory.

.xinitrc
exec twm
python test.py

It works after log in.

Thanks.

Re: start gui auto

Posted: Thu May 16, 2013 2:25 pm
by aijam
mrpi64 wrote:i think if you turn the file into an executable, and then change the last line(I THINK) in '/etc/profile' (AKA: put in the command ./script-name), it might work.

turn the file into executable by:

chmod -x script-name.py

then edit the profile file using:
sudo nano /etc/profile

hope this helps:
mrpi64
I also modified /etc/profile.
But after log in, console print some error.
It means Tk still need a X environment.