Debian Start Qt Gui Application with No Desktop

Debian Start Qt GUI application with no desktop

Yes you can do this without a window manager.

first: You need to boot into a non X session, init level 1 or 3.

second: You need to start the X server, in a basic mode by just calling X or xinit.

third: Start your app. You may need to take a little more control over where your app is positioned on the screen and its dimensions in your code, as you will not have a window manager to help with this.

alternatively: you can launch one of the more basic window managers to see how they play with your system. Motif Window Manager (mwm) and Tab Window Manager (twm)

Note: While working without a window manager, you may get into a state where you cannot do some very basic operations (ex: close a window, move a window, resize a window). You may find that you cannot survive without at least some of the more basic window management functions. Until you close the loop on this, remember, Ctrl + Alt + Backspace will kill the XServer.

Qt application GUI -- automatic start -- linux

You very probably need some X window manager to run your Qt application, perhaps even some desktop environment (i.e. you want EWMH & ICCCM compliance), and you obviously need a running X11 server (usually Xorg). So you could manage to have some xinitrc for all that.

Notice that some session -or display- managers like lightdm can be configured to start some special sessions.

In all cases, you need a lot more than just your application to be running, and you certainly need to understand in detail what your Qt application really requires (mostly thru Qt libraries). Learn more about the X11 protocol. See also freedesktop.org.

QT application Autostart --- in linux

1) You can simply create a script to start your application and add it to /etc/init.d folder, for example: /etc/init.d/S30myapp, which includes:

#!/bin/sh
/etc/my_qt_app -qws &

Of course, do not forget to chmod +x them.

2-3) The most simple solution is to use Qt Windowing System (QWS). Check here for more technical details.

4) Taken from tags from superuser:

Desktop-environments: Software that provides a graphical user
interface, with elements like icons, windows, toolbars, as well as
additional features. Popular examples include Gnome and KDE.

A window manager takes care of the placement and appearance of windows
in a GUI-driven operating system. Sometimes, the term also refers to
plugins that extend this basic functionality.

I don't know your requirements, but usually only windows manger is used in embedded devices. But as I mentioned before, Qt has its own windows manager - QWS. Another widespread option is X Server.

5) In case you use QWS (or any other windows manager), you can start your initial application and maximize it to full screen, so it will be the only application visible. However, check this discussion for multiple concurrent applications using QWS.

Making a Qt GUI application run on a framebuffer in Linux

Running Qt directly on the framebuffer is described here.

In short, you would use the linuxfb driver for Qt that will interface you with the /dev/fbX available on your system.

Some more info is also available here.

Minimal linux that can run Qt GUI application

http://www.tinycorelinux.com/

a 10 MB Linux distribution. boots within a few seconds.

Qt C++ application: self autostart installation in Linux

You can add application in various ways.

  1. Via linux init system. For newest linux OS systemd is a standard. In this case your need to create systemd unit for your application
  2. Via desktop manager, such as gnome, kde and possible others. In this case you need also create specification for autostarting your app.
  3. Via bash files

I think, prefered way via systemd unit, because now this is standard way for starting process at boot time and for special user, if need.

Running a Qt application at startup

You need to create a desktop entry file for your application (see here) and to put it in user's $HOME/.config/autostart directory.

Any desktop entry file in that dir will get executed when a Window Manager starts up (see here).

To do this, usually you'll need to create your desktop entry file by hand (that's it, not via C++ code/script) and to just install in that directory via C++ code.



Related Topics



Leave a reply



Submit