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 http://www.burtonini.com/blog/computers/devilspie. 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):
Other functions: if, and, or, begin.
/* Logical operations */
/* Matchers-- these give you some info about the window that opens*/
/* Actions */
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:
1. 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 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 (is (application_name) "XMMS") (set_workspace 2) (set_workspace_3))
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 (matches (window_name) "^Ubuntu.+") (begin maximize (set_workspace 2)))
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.
(if (or (is (application_name) "gaim") (is (application_name) "xchat")) (pin))
List of Tutorials (updated 2-2-2006):