1

I've seen solutions for non-PI situations to start the x-11 server without loading the desktop. I want to boot straight into my Python script that uses tkinter for the gui. I've found out that you need the x-11 running to draw the graphics. Is there a solution to this for the Raspberry Pi?? My app is full screen and when you switch windows you can see the desktop. Also, the only thing I want the end user to ever see is the app. No desktop, no internet, nothing. Is there a distro for the pi that does this?

I've started porting the app to use Kivy instead of tkinter and it's been horrible. I don't grasp the Kivy way of doing things. The only thing the app does is use the gpio ports to return temp values and switches between 4 screens. Should be very simple....sigh.

Any advice would be appreciated.

Thanks

3

You can certainly do this. You just need an X window manager running in place of a full desktop environment. I use openbox on my Raspberry Pi for exactly this purpose. I have the RPi configured to automatically log in as the Pi user on boot. On login, the pi user's bash shell reads the ~/.bashrc script and launches X via startx. X is configured to use openbox as the window manager. When launched, openbox reads commands from ~pi/.config/openbox/autostart. From there, I call my python script.

The (plain) X desktop will still be visible when you switch between apps (e.g. using Alt-Tab) but there won't be any spurious icons or docks. You can probably work around this if you really want to. I launch the FocusWriter app full screen, then shut down when it exits.

| improve this answer | |
  • Thanks Bob! This sounds very much like what I'd like to do. For clarification, what distro are you using? IE. raspbian? I'm sorry if this sounds newbie-ish, but I am new to linux in general. I would like to use a very very minimal OS for the PI due to boot times and memory usage. I'm assuming I use a raspian-like image, disable the starting of the desktop and tell it to start openbox instead. If you know of a good tutorial or write-up on this, I would be very appreciative!! I'd vote up your answer already but I don't have the rep yet. Also, will this impact the GPIO ports at all? – bhizzle1121 Apr 1 '15 at 23:36
  • Yes, Raspbian. I should have mentioned that. I am considering migrating to diet-pi, a minimal distribution, then rebuilding my project on that. – bobstro Apr 2 '15 at 3:48
  • Thanks for the response! I have downloaded a minimal Raspbian image since last post and installed xorg and openbox. I'm having a weird issue that when I type startx now, I get a black GUI (mouse moves with a crosshair pointer) but the top left corner of the screen is a bash prompt! It behaves just as normal bash. Can't right click and get any menus or middle click. I haven't messed with the xinit file yet, just wanted to run openbox. Ever seen THAT before? Google hasn't haha. – bhizzle1121 Apr 2 '15 at 3:57
  • I wouldn't expect it to impact GPIO in any way. There are many variations in how to configure X, but I simply created ~/.xinitrc (/home/pi/.xinitrc for the pi user) and put openbox & in it to launch openbox. The black GUI you are seeing is, I suspect, the result of not having launched a window manager. If you are seeing an xterm window when you launch startx, just type in openbox & (ampersand to background it) to test. Note that you can use a mix of .xinitrc and ~/.config/autostart, depending on whether you want things to start only under openbox or any X session. – bobstro Apr 2 '15 at 3:57
  • Thanks again Bob! Turns out that openbox never really installed correctly. I reinstalled it and now it's working fine. – bhizzle1121 Apr 2 '15 at 14:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.