5

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.

ynn
  • 850
  • 1
  • 11
  • 23

2 Answers2

3

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.

telcoM
  • 87,318
  • 3
  • 112
  • 232
1

For that I personally use a tool of my own, called unwin.

It's like telcoM answer, but automating when to wait for and close xvfb.

If xvfb isn't ready, it will wait for it. And once there are no programs running on the frame-buffer, xvfb is closed automatically.