Results 1 to 10 of 55

Thread: Devilspie (version 0.13 and greater) s-expressions examples

Threaded View

  1. #1
    Join Date
    Sep 2005
    Ubuntu 10.10 Maverick Meerkat
    The latest versions of devilspie uses s-expressions instead of xml syntax for the configuration files. This thread will be an attempt to collect s-expression examples from users so that others can use and learn from them. Let's try to follow a similar format and be sure to number your s-expressions so that they can easily be referred to if anyone has any questions (browse the ones already posted to make sure you are not reposting).

    This thread should be only for devilspie versions 0.13 and greater. The latest version in the repos is only 0.10. You can get the latest source for devilspie at If you are using a previous version there is already a great howto on the forums that you should read.

    Be sure to read: /usr/share/doc/devilspie-0.16/README (substitute 0.16 with the appropriate version). Most of the names of the logical operations, matchers, and actions should be descriptive enough to know what they do. If you aren't sure, try it and see! It would then be really nice if you could report back here to help others out with what you find . Here is a list, which may not be complete, of the possible code (for proper syntax search the examples):

      /* Logical operations */
      /* Matchers-- these give you some info about the window that opens*/
      /* Actions */
    Other functions: if, and, or, begin.

    And now some sample s-expressions to use in your ~/.devilspie/*.ds files (I'll copy the readme ones for completion). When reading these try to think of nested functions and read the innermost parentheses first:

    This will run the debug action for every window created. debug function will output the window title, geometry, etc. to the terminal window when you run devilspie in a terminal. This is a good way to determine application names to use in your s-expressions.

    (if (is (application_name) "XMMS") (set_workspace 2) (set_workspace_3))
    If a window's application_name is "XMMS", the first action, (set_workspace 2), will be run, which will send XMMS to your second workspace everytime you open it. If (is (application_name) "XMMS") returns false, if will run the second action instead, in this case (set_workspace 3). So all aplications that are not XMMS will show up in your third workspace.

      (if (matches (window_name) "^Ubuntu.+") (begin maximize (set_workspace 2)))
    Matches allows you to use regular expressions. Here, if a window name starts with "Ubuntu" if will run the first action, (begin maximize (set_workspace 2)). This will then maximize those windows and send them to your second workspace.

    (if (or (is (application_name) "gaim") (is (application_name) "xchat")) (pin))
    If an application has the name "gaim" or an application has the name "xchat", the first action, (pin), will be run. (pin) will make your window visible on all workspaces.

    List of Tutorials (updated 2-2-2006):
    Last edited by jrib; March 1st, 2006 at 02:27 AM.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts