0

I'm using Linux Mint MATE. I would like to launch a gui application without recognized by my eyes. I tried the following code which launches the application and moves it to another workspace with wmctrl right after the launch but that didn't work.

some_app_with_gui &
wmctrl -r title -t 1 #move window to another workspace (Say I'm in workspace 0 now)

As indicated here, the reason is that wmctrl is executed before some_app_with_gui's window appers. So the solution would be

some_app_with_gui &
sleep 0.8
wmctrl -r title -t 1 #move window to another workspace (Say I'm in workspace 0 now)

and this actually works.

With this solution, however, the window is recognized by my eyes for a moment (0.1 seconds or so). This is truly annoying and I'd like to avoid it.

Are there any solutions? It doesn't necessarily have to use wmctrl. Any other commands will be ok. And please note I don't access the window, i.e. the application is launched by a script and closed by the scripts, so completely hiding the window is ok.


How this question is different from ones with similar titles is

  • that only one machine is involved (not SSH-related)

  • and that I would like to launch gui application on a machine with a desktop environment without gui.

2

You could use a virtual framebuffer X server, Xvfb.

For example:

Xvfb :99 &
DISPLAY=:99 some_app_with_gui &

This runs the application on an entirely virtual X display, which has no visible presence on any physical display at all.

Xvfb is typically a separate package, so you might need to use your distribution's package manager to install it before using it.

  • Thank you. It worked really well on Linux Mint Mate 19 after sudo apt install xvfb. – ynn Apr 14 at 8:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.