Commands like wmctrl and xdotool allow:

  1. Switching the current desktop
  2. Moving a running X Windows program to another desktop

I'd like to know whether it's possible to start an X11 program such that it starts on particular desktop, rather than moving it later, and without changing the current desktop.

The reason I'd like to do that is that I'd like to start programs on other desktops, but sometimes they are slow to start, and I don't want to have to wait for that -- I'd rather switch to another desktop while the program is starting. I also don't want to leave a wrapper shell process around for every X program I start, which seems to make 2. problematic. Also, both 1. and 2. seem likely to be flaky compared with just starting the program on the right desktop in the first place, if that's possible.

I'm using gnome shell.

  • I don't know about gnome, but I can do it in kde plasma. Mar 14 '20 at 16:31

you can use devilspie. But you have to write config files by your own. They should be stored in folder $HOME/.devilspie/ (if folder not exist create it).

Here an example for firefox. $HOME/.devilspie/firefox.ds

  (is (application_name) "Firefox")
  (set_workspace 2)

From here you can download the gui gdevilspie. But I have no experience with it.

How to find programname

xprop | grep WM_CLASS\(STRING\) 

Your mouse-cursor change, then click into the window.

The successor is devilspie2 (with lua interpreter, no knowledge about lua). So I can only give you a wiki link

  • It actually took me a moment to figure out that, at least on ubuntu 18.04 with the packaged devilspie, I also have to start devilspie myself. When it starts, it moves all windows already running to the specified desktops -- so it's not necessary to run a new X program for devilepie to move it to the right desktop (but if you do, they'll end up on the right desktop too). Mar 28 '20 at 12:28

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.