4

I need to be able to render my own GUI to the screen, but I'm not really sure how to do this considering I'm in a CLI environment. I don't want to install Ubuntu-desktop or anything, I don't need an entire desktop, just the ability to render directly to the screen.

I've read a bit about X. I assume I need to make something that implements it. Are there references that explain this? I'm assuming a low level language (e.g. C) will be necessary, but obviously I'd feel more comfortable if it was a higher level language required (e.g. Python).

Please let me know, I can't seem to find anything on Google. I don't think I'm searching for the right thing, perhaps I just need refined search terms.

What I'm developing is an application that I want to install on a single board computer. The computer would only be used for the purpose of this application, so I don't want to waste resources loading ubuntu-desktop or gnome just so that I can render my application. I really just don't want the extra overhead. Let me know if that changes anything.

aquaherd
  • 6,345

2 Answers2

4

If you want to do full-screen applications with no windows involved and use Python over C, you have several options:

Game engines: For example the SDL library. Python bindings exist here. SDL applications run on top of X, wayland, framebuffer, SVGALib and much more. It will give you full-screen graphics and for a SOC you will only need a frame-buffer-device, e.g. when you see the Linux mascot during boot, you are already there. However, if you have some advanced GUI like a modern car cockpit in mind, it might involve OpenGL for anti-aliasing. For an ATM (automatic teller machine) like GUI it will miss the standard buttons and boxes which you would have to implement yourself. Many SDL games in the ubuntu repositiories can be recompiled to run under a framebuffer.

Linux installers: The debian-installer uses the gtk+ toolkit on top of a framebuffer device, no X involved. You will have all Gtk+ widgets at your command, and good text rendering with pango, modern graphics with anti-aliasing with cairo. Python bindings exist. The OpenSuse distribution has a similar installer on top of QT.

Text mode graphics (TUI): If you have only text output with a few buttons to render, consider using the ncurses library. It will allow you a textual user interface with a high-level API. midnight-commander is a good example. Python bindings exist.

Commercial biddings: If this is a professional project, employing other commercial toolkits and realtime operating systems is an option. See also this and similar tagged questions, even without linux at Stack Overflow.

Helpful search keywords

  • microcontroller gui library
  • immediate mode graphics
  • DirectFB
  • RTOS graphics
  • RTOS gui toolkit
  • custom linux gui
aquaherd
  • 6,345
1

Most users who don't install GUIs don't want to run GUI applications. There are many options for installing a GUI on a server and some of them are quite lightweight. You do not need a whole desktop environment to use the X window system. Installing X11 and a window manager, or possibly even a lightweight desktop environment, will probably do what you need.

If you've considered that (including the part about CLI users wanting to run CLI programs), you probably have a remarkable, unique set of circumstances for wanting to do this. If you expand your question to explain them, you might get more useful answers.

If you really do want to reinvent the lightbulb and reimplement your own GUI, aquaherd's comment (which I'm hoping will become an answer soon) explains the basics of how.

Eliah Kagan
  • 119,640