Devilspie 2
-----------
Devilspie 2 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:
-h, --help Show help options
-d, --debug Print debug information to stdout
-e, --emulate Don't apply any rules, but only emulate execution
-f, --folder From which folder should we load our LUA scripts
-v, --version Print program version and quit
simple script example:
---------------------8<---------------------
-- the debug_print command does only print anything to stdout
-- if devilspie2 is run using the --debug option
debug_print("Window Name: " .. get_window_name());
debug_print("Application name: " .. get_application_name())
-- I want my Xfce4-terminal to the right on the second screen of my two-monitor
-- setup. (Strings are case sensitive, please note this when creating rule
-- scripts.)
if (get_window_name()=="Terminal") then
-- x,y, xsize, ysize
set_window_geometry(1600,300,900,700);
end
-- Make Iceweasel always start maximized.
if (get_application_name()=="Iceweasel") then
maximize();
end
--------------------->8---------------------
You can choose to have all script functionality in one file, or you can split
it up into several, Devilspie2 runs on all LUA files in .config/devilspie2 -
that is all files with a .lua extension.
Scripting
---------
The scripting language used is LUA (see www.lua.org) - See FAQ at
www.lua.org/FAQ.html
, documentation at
www.lua.org/docs.html
, and tutorials at
http://lua-users.org/wiki/TutorialDirectory
The following commands are recognized by the Devilspie2 LUA interpreter:
debug_print(string)
Debug helper that prints a string to stdout. The string is only printed to
stdout if devilspie2 is run with the --debug option, otherwise nothing will
be printed.
get_window_name()
returns a string containing the name of the current window.
set_window_position(xpos,ypos)
Set the position of a window.
set_window_size (xsize, ysize)
Sets the size of a window - takes xsize and ysize as parameters.
set_window_geometry (xpos, ypos, xsize, ysize)
Sets both size and position of a window in one command. Takes four
parameters, xpos, ypos, xsize and ysize.
get_application_name()
returns the application name of the current window.
make_always_on_top()
Sets a window always on top.
set_on_top()
sets a window on top of the others. (unlike make_always_on_top, it doesn't
lock the window in this position.)
shade()
"Shades" a window, showing only the title-bar.
unshade()
Unshades a window - the opposite of "shade"
maximize()
maximizes a window
unmaximize()
unmaximizes a window
maximize_vertically()
maximizes the current window vertically.
maximize_horisontally()
maximizes the current window horisontally.
minimize()
minimizes a window
unminimize()
unminimizes a window, that is bringing it back to screen from the minimized
position/size.
decorate_window()
Shows all window decoration.
undecorate_window()
Removes all window decorations.
set_window_workspace(number)
Moves a window to another workspace. The number variable starts counting at
1.
change_workspace(number)
Changes the current workspace to another. The number variable starts counting
at 1.
pin_window()
asks the window manager to put the window on all workspaces.
unpin_window()
Asks the window manager to put window only in the currently active workspace.
stick_window()
Asks the window manager to keep the window's position fixed on the screen,
even when the workspace or viewport scrolls.
unstick_window()
Asks the window manager to not have window's position fixed on the screen
when the workspace or viewport scrolls.
get_window_geometry()
Returns the window geometry as four numbers - x-position, y-position,
width and height.
get_window_client_geometry()
returns the window geometry excluding the window manager borders as four
numbers, x-position, y-position, width and height.
set_skip_tasklist(skip)
Set this to true if you would like the window to skip listing in your
tasklist. Takes a boolean(true or false) as value.
set_skip_pager(skip)
Set this to true if you would like the window to skip listing in your pager.
Takes a boolean(true or false) as value.
Please note that strings are case sensitive, comparing "SomeProgram" with
"someprogram" will not report equality.
Translations
------------
Devilspie2 is now translatable using gettext - see README.translators for more
information.
Authors
-------
Andreas Rönnquist <gusnan@gusnan.se>
- Code, Swedish translation
Robin Hahling <robin.hahling@gw-computing.net>
- French translation
Contact
-------
Author: Andreas Rönnquist
E-mail: gusnan@gusnan.se
Homepage: http://www.gusnan.se/devilspie2