Devilspie2 is based on the excellent program Devil's Pie by Ross Burton, and takes a folder as indata, and checks that folder for LUA scripts. These scripts are run each time a window is opened, and the rules in them are applied on the window.
Unfortunately the rules of the original Devils Pie are not supported.
If you don't give devilspie2 any folder with --folder, it will read LUA scripts from the folder that it gets from the GLib function g_get_user_config_dir - this returns the config directory as defined in the XDG Base Directory Specification. In most cases would be the ~/.config/devilspie2/ folder, and this folder will be created if it doesn't already exist. This folder is changeable with the --folder option. If devilspie2 doesn't find any LUA files in the folder, it will stop execution.
Devilspie2 takes some options:
A simple script example can look like this:
You can choose to have all script functionality in one file, or you can split it up into several, Devilspie2 searches the folder .config/devilspie2/ for all files with a .lua extension.
The following commands are recognized by the LUA interpreter:
First, a function to show some debug info:
Debug helper that prints a string to stdout. The string is only printed to stdout if devilspie2 is run in debug mode (with the --debug option), otherwise nothing will be printed.
Then, there's the functions to get the properties of windows:
returns as string containing the name of the current window.
returns a boolean (true or false) depending on if a window has a name or not.
returns the application name of the current window.
Returns the window geometry as four numbers - x-position, y-position, width and height. (from version 0.16)
returns the window geometry excluding the window manager borders as four numbers, x-position, y-position, width and height. (from version 0.16)
Returns true if the window is maximized, false otherwise. (available from version 0.21)
Returns true if the window is vertically maximized, false otherwise. (available from version 0.21)
Returns true if the window is horisontally maximized, false otherwise. (available from version 0.21)
Returns the type of the window - The result type is a string, and can be one of the following:
Gets the class instance name from the WM_CLASS Property for the current window. Only available on libwnck 3+, and in devilspie2 version 0.21 or later.
Returns the window property described in the property string. For a list of available properties, you should see the page http://standards.freedesktop.org/wm-spec/wm-spec-latest.html (Available from version 0.21)
Returns a string describing the current window role of the matched window as defined by it's WM_WINDOW_ROLE hint.
Returns the X window id of the current window.
Returns a string representing the class of the current window.
Sets the position of a window.
Set the position of a window - Compared to set_window_position, this function uses XMoveWindow instead of wnck_window_set_geometry which gives a slightly different result. (Available from version 0.21)
Sets both position and size of a window in one command. Takes four parameters, xpos, ypos, width and height.
Sets the window geometry just as set_window_geometry, using XMoveResizeWindow instead of its libwnck alternative. This results in different coordinates than the set_window_geometry function, and results are more similar to the results of the original devilspie geometry function. (available from version 0.21)
Sets a window always on top.
Sets a window on top of the others. (unlike make_always_on_top, it doesn't lock the window in this position.)
"Shades" a window, showing only the title-bar.
Unshades a window - the opposite of "shade".
Maximizes a window.
Unmaximizes a window.
Maximizes the current window vertically.
Maximizes the current window horisontally.
Minimizes a window.
Unminimizes a window, that is bringing it back to screen from the minimized position/size.
Shows all window decorations.
Removes all window decorations.
Moves a window to another workspace. The number variable starts counting at 1.
Changes the current workspace to another. The number variable starts counting at 1.
Asks the window manager to put the window on all workspaces.
Asks the window manager to put window only in the currently active workspace.
Asks the window manager to keep the window's position fixed on the screen when the workspace or viewport scrolls.
Asks the window manager to not have the window's position fixed on the screen when the workspace or viewport scrolls.
Set this to true if you would like the window to skip listing in your tasklist. Takes a boolean (true or false). (from version 0.16)
Set this to true if you would like the window to skip listing in your pager. Takes a boolean (true or false) as value. (from version 0.16)
Set the current window above all normal windows. (Available from version 0.21)
Set the current window below all normal windows. (Available from version 0.21)
Asks the window manager to set the fullscreen state of the window according to the fullscreen boolean. (Available from version 0.24)
Moves the window to the requested viewport - Counting starts at number 1. (Available from version 0.25)
Centers the current window on the current workspace. (Availible from version 0.26)
TranslationsDevilspie2 is translatable using gettext - see README.translators for more information.
Andreas Rönnquist - <firstname.lastname@example.org>
Robin Hahling - <email@example.com>
Hélder Máximo Botter Ribas - <firstname.lastname@example.org>
ContactAuthor: Andreas Rönnquist
Google groups: http://groups.google.com/group/devilspie2
IRC: #devilspie2 on irc.freenode.net