File: README

package info (click to toggle)
devilspie2 0.20-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 208 kB
  • sloc: ansic: 1,097; makefile: 121; xml: 28
file content (262 lines) | stat: -rw-r--r-- 5,876 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262


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 with
devilspie2/ added to the end - g_get_user_config_dir 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
-w, --wnck-version  Show version of libwnck 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.


get_window_has_name()

   return true or false depending on if the window has a name or not
   (from version 0.20)


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. (from version 0.16)


get_window_client_geometry()

   returns the window geometry excluding the window manager borders as four
   numbers, x-position, y-position, width and height. (from version 0.16)


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. (from version 0.16)


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. (from version 0.16)


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
-------

see the AUTHORS file


Contact
-------

Author: Andreas Rönnquist
E-mail: gusnan@gusnan.se
Homepage: http://www.gusnan.se/devilspie2
Google groups: http://groups.google.com/group/devilspie2