Python GUI without running startx?

15 posts
by shardina » Thu Jun 07, 2012 5:30 am
Would there be a significant performance benefit to running a Python GUI without X Windows via this method?

That plus a pyGame GUI toolkit like PGU seems like a great way to start in your own custom GUI environment without a bunch of X overhead. For example, it would be nice to be able to boot into something optimized for launching your (similarly custom-GUI'd) programs with limited input, like a small touchscreen or a TV/WiiMote combo, or boot a Pi directly into something intended to be standalone like a software synth, surveillance system, information kiosk, etc. But, I'm pretty newbish to most programming outside of web development, so I'm not sure what's realistic there.
Posts: 4
Joined: Thu Jun 07, 2012 5:05 am
by texy » Thu Jun 07, 2012 12:27 pm
Well if you have a Pi to play with why not give it a try and let us all know ;-)

Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
Forum Moderator
Forum Moderator
Posts: 4955
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England
by shardina » Thu Jun 07, 2012 2:52 pm
Still waiting on it to arrive! It's shipped, though.
Posts: 4
Joined: Thu Jun 07, 2012 5:05 am
by Jaseman » Fri Jun 08, 2012 7:44 am
It depends on what your Python program was doing, but I don't think you would notice any performance boost by running it without LXDE in the background.
Posts: 302
Joined: Tue Jan 10, 2012 12:59 pm
by rurwin » Fri Jun 08, 2012 8:04 am
Even without the overhead issue, LXDE has a lot of fiddly bits that you don't want to be bother with for a game or a kiosk.

If you didn't want to write the windowing system from scratch, then you could ditch LXDE and use the X window system without a desktop/window manager. It would be rather sparse and your Python program would have to do more work keeping track of the windows, but certainly less so than if you did the whole thing in Python.
User avatar
Forum Moderator
Forum Moderator
Posts: 4166
Joined: Mon Jan 09, 2012 3:16 pm
by redfox05 » Mon Jul 23, 2012 10:36 pm
Sounds like an interesting proposal though, I'd be interested to see how this goes.
Posts: 5
Joined: Mon Jul 23, 2012 10:30 pm
by kobzar » Tue Jul 24, 2012 5:51 am
don used gui withouyt X. be cause you drink poison when try to wroute hooks method from keys on clear python..
No Fate!
Posts: 37
Joined: Tue Jul 17, 2012 1:09 pm
Location: Ukraine
by timhoffman » Tue Jul 24, 2012 11:30 am

If you want to embark on the non X GUI then I think it's worth having a read of this review of pygame based GUIs. It might give you some ideas.


Posts: 85
Joined: Sat Nov 05, 2011 11:31 pm
by Yam » Wed Jul 25, 2012 12:26 pm
You do get a proformance boost and more importantly you get to set the display mode
(under X window whatever mode you chose i.e 256 colours gets converted to whatever x window is running which results in more overhead again)

But if proformance is what your after why not use the SDL libary with C++
I'm learning in python and enjoying myself but when i've done a couple of games i'm going to be switching to C++.
Posts: 68
Joined: Wed May 16, 2012 12:14 pm
by wagnerc4 » Thu Oct 25, 2012 12:48 pm
This can help: ... x-windows/

It is posible a web-browser with out x window, with webkit.
Posts: 3
Joined: Thu Oct 25, 2012 12:44 pm
by pstorey » Thu Oct 25, 2012 1:32 pm
I am also very interested to know how you get on as this is exactly what i am looking to do..

I have got auto login pass through to LXDE but want to just have the x-server run and the initial python script start..

I've had a couple of replies to a similar thread i started a while ago but have been concentrating on my wxpython wrapper for the omx player and have not tried any of the suggestions yet..


Good to know i'm not alone at trying to achieve this..

User avatar
Posts: 52
Joined: Wed Sep 19, 2012 11:14 am
by wagnerc4 » Tue Nov 06, 2012 3:33 am
Web browser inside opengl
Posts: 3
Joined: Thu Oct 25, 2012 12:44 pm
by eglionel » Tue Nov 06, 2012 2:45 pm
Good news: First Raspberry PI (directfb) binaries for Raspbian -->
Posts: 1
Joined: Tue Nov 06, 2012 2:41 pm
by merlz42 » Wed Nov 07, 2012 12:59 pm
SDL supports non-X11 use, so it should be possible to configure pygame to launch fullscreen without using X.

Edit - try this python code:
import os
os.environ['SDL_VIDEODRIVER']="fbcon" # could be "directfb", try "aalib" for extra fun

#pygame code goes below
Posts: 20
Joined: Sun May 13, 2012 1:19 pm
by pstorey » Wed Apr 19, 2017 3:48 pm
While this might be an old thread I'm now using Kivy which enables me to use the touch screen and a UX without a full desktop and is similar to a kiosk experience. I'm currently developing a full media player and carputer with virtual dials for a camper van conversion project. The link to the project is here..
User avatar
Posts: 52
Joined: Wed Sep 19, 2012 11:14 am