2

Ok.. I finally got around to installing devilspie2 and running through this very clear tutorial. Of course, it is not working. However, all my reading leads to 3 year old articles and troubleshooting.

Question 1:

Is devilspie2 still applicable / compatible with gnome version 3.36.8 on ubuntu 20.04 running X11 window manager?

Assuming it is still applicable / compatible... (github repository still active https://github.com/dsalt/devilspie2)

Question 2:

What am I doing wrong? My script(s) have no effect on windows of any applications:

debug_print("Application: " .. get_application_name())
debug_print("Window: " .. get_window_name());

if (get_window_name() == "gedit") then set_window_workspace(8); end

if (get_window_name() == "Mozilla Firefox") then set_window_geometry(50, 100, 800, 600); end

devilspie2 --debug runs without problem and confirms that is reading the file that contains my scripts

Using scripts from folder: /home/user/.config/devilspie2
------------
List of Lua files handling "window_open" events in folder:
/home/user/.config/devilspie2/debug.lua
List of Lua files handling "window_close" events in folder:
List of Lua files handling "window_focus" events in folder:
List of Lua files handling "window_blur" events in folder:
------------

I can find no errors in my system logs related to devilspie2 and/or lua

I have restarted display-manager and I have fully rebooted... no effect.

Any tips?

Additional Info
This my list of installed gnome-extensions in case there is some sort of conflict someone can recognize:
enter image description here

nightwatch
  • 805
  • 3
  • 23
  • 51

1 Answers1

3

Question 1: Is devilspie2 still applicable / compatible with gnome version 3.36.8 on > ubuntu 20.04 running X11 window manager?

It is, even on 22.04, provided your run X11. It will not work on Wayland.

Question 2: What am I doing wrong? My script(s) have no effect on windows of any applications:

If your configuration file is correct, and devilspie2 is running (check in the output of ps ax | grep devilspie2) then the installation should be correct. There still may be specific reasons why some rules do not work.

  • get_window_name() will return the window title. (get_window_name() == "Mozilla Firefox") will only match a window with the exact title "Mozilla Firefox", i.e., an empty, new Firefox window. A window of Gedit never is named gedit, so will never be matched. Use e.g. (string.match(get_window_name(), "Mozilla Firefox")) or (string.match(get_window_name(), "gedit")) to match a substring in the window title.

  • set_window_workspace(8); will work only provided there is a workspace 8. For this to work on Gnome Shell, change to "Static workspaces" in "Settings", "Multitasking" (Ubuntu 22.04) or in Gnome Tweaks (earlier versions).

Tips

  • You can "debug" your devilpie2 setup by killing the running proces (killall devilspie2, then adapt the configuration file, then restart devilspie2. In that terminal, you can conveniently kill devilspie2 using Ctrl+C and restart it again.

  • A quite comprehensive manual listing all commands is hidden on your system after you installed devilspie2. Use less /usr/share/doc/devilspie2/README.gz to see it.

  • Do not hesitate to use the window class instead of a title. That can for example avoid that a firefox window opened on an article about gedit is being matched as a gedit window:

      if (get_window_class() == "Gedit") then
          set_window_workspace(8);
      end
    

    See the window class in the output of wmctl -lx, or xprop | grep WM_CLASS (second entry).

vanadium
  • 97,564