I have had lots of trouble with running a pygame application such as the pre-installed wormy.py (or any application like lxterminal or minecraft-pi) on a Pi from the command-line. This means without entering the Raspbian desktop.
I have tried all the proposed solutions in the (inevitable) linked questions list:
- From: Running X11 without Window Manager?
- The screen turns black for a millisecond but immediately returns to the terminal again with a "server terminated successfully" and a "x server connection lost".
- From: How can I start X11 only for a single application?
- This is the same as above (pretty much a duplicate but more specific to Chrome). The .xinitrc doesn't appear to have any effect at all.
- From: Run GUI app from command line
- This had no effect. Nothing happened at all when running any app.
- From: Run a GUI without the desktop
- I did exactly as the accepted answer says from a fresh Raspbian installation but no dice. Also, that ctrl-alt-backspace trick to kill the GUI didn't work to kill the main Raspbian GUI - maybe I misunderstood or missed something?
- From: Pygame from command line vs GUI
- This looked promising until I failed to produce the same results and also got confused with the instructions.
- From: How to set up "kiosk" mode in Raspbian?
- Although I eventually want to boot directly to a GUI app from startup (without using the desktop!), I want to be able to run a command from the command-line at first, for testing purposes.
Is there any resource that provides a simple-to-follow step-by-step guaranteed-to-work(!) set of instructions on how I can run a GUI application from the command-line without the window manager (i.e. just X)?
Contents of the .xinitrc:
#!/bin/sh
# /etc/X11/xinit/xinitrc
#
# global xinitrc file, used by all X sessions started by xinit (startx)
# invoke global X session script
. /etc/X11/Xsession
exec /usr/share/raspi-ui-overrides/applications/minecraft-pi