Start Qt Application without going through a window manager
-
wrote on 19 Jul 2017, 10:41 last edited by
Hi all. I'm facing a problem with my application. I have a Qt application starting via Systemd (need it this way). What I did before was start the kwin_x11 window manager from a .xinitrc file and then attach to the X server via the
DISPLAY=:0
variable in the launch command.Is there any way to start the application from systemd without going through a window manager?
Thanks in advance
-
Hi all. I'm facing a problem with my application. I have a Qt application starting via Systemd (need it this way). What I did before was start the kwin_x11 window manager from a .xinitrc file and then attach to the X server via the
DISPLAY=:0
variable in the launch command.Is there any way to start the application from systemd without going through a window manager?
Thanks in advance
@nwoki Does it have to be a GUI application? If not you can just create a console application.
-
@nwoki Does it have to be a GUI application? If not you can just create a console application.
wrote on 19 Jul 2017, 10:43 last edited by@jsulm said in Start Qt Application without going through a window manager:
@nwoki Does it have to be a GUI application? If not you can just create a console application.
Yes. It has to be a Gui application
-
@jsulm said in Start Qt Application without going through a window manager:
@nwoki Does it have to be a GUI application? If not you can just create a console application.
Yes. It has to be a Gui application
@nwoki But why do you want to start a GUI application via systemd? Where do you expect to see the GUI?
-
@nwoki But why do you want to start a GUI application via systemd? Where do you expect to see the GUI?
wrote on 19 Jul 2017, 10:47 last edited by@jsulm said in Start Qt Application without going through a window manager:
@nwoki But why do you want to start a GUI application via systemd? Where do you expect to see the GUI?
Because i need the application to restart in case of a crash. I expect to see my Qt application window shown on the screen connected to the pc in use. This is how it's supposed to work:
1 - attach the ac plug to the pc
2 - switch on the pc
3 - application starts automatically WITHOUT passing through sddm/kdm/gdm/kwin_x11/twm/fluxbox etc. It's a pc with a product that starts on boot. -
@jsulm said in Start Qt Application without going through a window manager:
@nwoki But why do you want to start a GUI application via systemd? Where do you expect to see the GUI?
Because i need the application to restart in case of a crash. I expect to see my Qt application window shown on the screen connected to the pc in use. This is how it's supposed to work:
1 - attach the ac plug to the pc
2 - switch on the pc
3 - application starts automatically WITHOUT passing through sddm/kdm/gdm/kwin_x11/twm/fluxbox etc. It's a pc with a product that starts on boot.@nwoki said in Start Qt Application without going through a window manager:
I expect to see my Qt application window shown on the screen connected to the pc in use
Do you use a desktop manager? If so do you want to show the app for the currently logged on user? If no user is logged on and only the log-in window is shown: where do you want to show the app?
-
wrote on 19 Jul 2017, 10:58 last edited by nwoki
- I do not use a Desktop manager and I don't want to
- I want my application to start ONLY X server and nothing else
Is there a way to actually acheive this or am i missing something?
-
wrote on 19 Jul 2017, 11:09 last edited by
Hi,
it possible that I am missing something here but I my solution would be two-fold:- small deamon-like program that actually monitors if target app is running and if requirements for it to run are met;
- target app (your main program) that runs in front the way you like.
-
Hi,
Then shouldn't you rather avoid X altogether and use Qt for Embedded Linux ?
-
Hi,
Then shouldn't you rather avoid X altogether and use Qt for Embedded Linux ?
wrote on 21 Jul 2017, 08:39 last edited by@SGaist said in Start Qt Application without going through a window manager:
Hi,
Then shouldn't you rather avoid X altogether and use Qt for Embedded Linux ?
Why? The application is running on a normal pc. Anyway, I'll stick to using
kwin_x11
and figure something out -
Embedded doesn't mean it should be credit card size, an ATM is a sort of embedded system even if its locked in a wall.
From your description, it looks like your system should be some sort of kiosk since you don't want any window manager hence my suggestion of using one of the other backends available. This will also have the advantage of reducing the requirements and dependencies of your system.
-
wrote on 25 Jul 2017, 13:28 last edited by
I also have a window-less GUI application on ubuntu. To get rid of the window manager I made a new desktop which auto launches the app.
However if it crashes, it does not restart and I still did not manage to prevent the display from going to sleep after x minutes. But I do not expect my application to crash on my target system. This might be a solution?
-
@bask185 What might be a solution ?
-
Embedded doesn't mean it should be credit card size, an ATM is a sort of embedded system even if its locked in a wall.
From your description, it looks like your system should be some sort of kiosk since you don't want any window manager hence my suggestion of using one of the other backends available. This will also have the advantage of reducing the requirements and dependencies of your system.
wrote on 25 Jul 2017, 22:02 last edited by@SGaist said in Start Qt Application without going through a window manager:
Embedded doesn't mean it should be credit card size, an ATM is a sort of embedded system even if its locked in a wall.
From your description, it looks like your system should be some sort of kiosk since you don't want any window manager hence my suggestion of using one of the other backends available. This will also have the advantage of reducing the requirements and dependencies of your system.
Sorry for the late reply.
Yeah, I looked that up but didn't think it was necessary and that maybe there was another way. I'll try the
eglfs
platform plugin (via the-platform eglfs
switch) and see if it does what I expect it to. I'll get back to you -
wrote on 26 Jul 2017, 12:57 last edited by
In the end i'm using matchbox and launching the application with the
-platform eglfs
flag activated. There's no way in getting the app to run directly on X (which is what I wanted to achieve in the beginning) so I'm going with a very slim window manager. -
Then you need the xcb backend.
1/16