I am working on a project that needs a special GUI that takes up the full screen.
I know I can make the X-Window system start up on boot (using raspi-config
then changing the setting) but is it possible to just load the bare minimum to display the GUI (created in Glade) and then automatically start the python script? I don't want to display the desktop ever, as it is a type of Virtual Operating System.
3 Answers 3
Drawing directly on the screen (frame buffer) is actually much faster than using X when you are using Broadcom's VideoCore (OpenVG) library. The major resources you need to look at, including examples and source code, are already pre-installed on Rapsberry Pi. For example, try this in console mode:
cd /opt/vc/src/hello_pi/hello_triangle
sudo make
./hello_triangle
You will see a full screen GUI is shown. You may also want to look at a very nice wrapper library that makes using OpenVG much easier, which includes additional very nice examples.
For starting up a program automatically, you can add it in your /etc/rc.local
file, just before exit 0
, like this:
#....
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
/your/path/your_fancy_gui &>/dev/null &
exit 0
Note you need to use &
to put the program in the background, or the system boot sequence would be stopped there until you program quits.
-
Perfect! This is EXACTLY what I was looking for! Thank you so much! Will definitely include a reference to you in the final product somewhere somehow!RPiAwesomeness– RPiAwesomeness2013年09月13日 01:08:27 +00:00Commented Sep 13, 2013 at 1:08
You need some kind of window manager to have a GUI. You could make a text based UI instead! (ncurses may be helpful)
-
That I know, but I was hoping to find a slightly more in-depth answer if it is possible. I know that I need some kind of window manager, but I don't want to display any icons, menus, menu-bars, window border (Name, Icon, Buttons)s, etc. I just want to be able to display a window (blank, white) so that I can make a simple UI for the Virtual OS.RPiAwesomeness– RPiAwesomeness2013年09月11日 19:39:21 +00:00Commented Sep 11, 2013 at 19:39
You don't need a window manager, or even X.
I'm starting up to the console and running a program via auto-login. The program simply draws the GUI on the framebuffer.
-
That's possible? Do you have any links to sites I could look at for info on this, or some of the code/special setup that you used? That would be great, thanksRPiAwesomeness– RPiAwesomeness2013年09月12日 12:06:26 +00:00Commented Sep 12, 2013 at 12:06
sudo nano ~/.config/autostart/FullScreenApp.desktop
and then use pygtkgtk.Window.fullscreen()
(I didn't try)