1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
3 <!--Converted with LaTeX2HTML 2002-2-1 (1.71)
4 original version by: Nikos Drakos, CBLU, University of Leeds
5 * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
6 * with significant contributions from:
7 Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
10 <TITLE>3. Basic configuration</TITLE>
11 <META NAME="description" CONTENT="3. Basic configuration">
12 <META NAME="keywords" CONTENT="ionconf">
13 <META NAME="resource-type" CONTENT="document">
14 <META NAME="distribution" CONTENT="global">
16 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
17 <META NAME="Generator" CONTENT="LaTeX2HTML v2002-2-1">
18 <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
20 <LINK REL="STYLESHEET" HREF="ionconf.css">
22 <LINK REL="next" HREF="node5.html">
23 <LINK REL="previous" HREF="node3.html">
24 <LINK REL="up" HREF="ionconf.html">
25 <LINK REL="next" HREF="node5.html">
30 <DIV CLASS="navigation"><!--Navigation Panel-->
33 <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
36 <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
39 <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
42 <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>
45 <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A>
47 <B> Next:</B> <A NAME="tex2html268"
48 HREF="node5.html">4. Graphical styles</A>
49 <B> Up:</B> <A NAME="tex2html262"
50 HREF="ionconf.html">Configuring and extending Ion3</A>
51 <B> Previous:</B> <A NAME="tex2html256"
52 HREF="node3.html">2. Preliminaries: Key concepts</A>
53 <B> <A NAME="tex2html264"
54 HREF="node1.html">Contents</A></B>
55 <B> <A NAME="tex2html266"
56 HREF="node11.html">Index</A></B>
59 <!--End of Navigation Panel-->
60 <!--Table of Child-Links-->
61 <A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>
63 <UL CLASS="ChildLinks">
64 <LI><A NAME="tex2html269"
65 HREF="node4.html#SECTION00410000000000000000"><SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">1</SPAN> The configuration files</A>
66 <LI><A NAME="tex2html270"
67 HREF="node4.html#SECTION00420000000000000000"><SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">2</SPAN> A walk through <SPAN CLASS="textit">cfg_ion.lua</SPAN></A>
68 <LI><A NAME="tex2html271"
69 HREF="node4.html#SECTION00430000000000000000"><SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">3</SPAN> Keys and rodents</A>
71 <LI><A NAME="tex2html272"
72 HREF="node4.html#SECTION00431000000000000000"><SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">1</SPAN> Binding handlers and special variables</A>
73 <LI><A NAME="tex2html273"
74 HREF="node4.html#SECTION00432000000000000000"><SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">2</SPAN> Guards</A>
75 <LI><A NAME="tex2html274"
76 HREF="node4.html#SECTION00433000000000000000"><SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">3</SPAN> Defining the bindings</A>
77 <LI><A NAME="tex2html275"
78 HREF="node4.html#SECTION00434000000000000000"><SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">4</SPAN> Examples</A>
79 <LI><A NAME="tex2html276"
80 HREF="node4.html#SECTION00435000000000000000"><SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">5</SPAN> Key specifications</A>
81 <LI><A NAME="tex2html277"
82 HREF="node4.html#SECTION00436000000000000000"><SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">6</SPAN> Button specifications</A>
83 <LI><A NAME="tex2html278"
84 HREF="node4.html#SECTION00437000000000000000"><SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">7</SPAN> A further note on the default binding configuration</A>
87 <LI><A NAME="tex2html279"
88 HREF="node4.html#SECTION00440000000000000000"><SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">4</SPAN> Menus</A>
90 <LI><A NAME="tex2html280"
91 HREF="node4.html#SECTION00441000000000000000"><SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">4</SPAN>.<SPAN CLASS="arabic">1</SPAN> Defining menus</A>
92 <LI><A NAME="tex2html281"
93 HREF="node4.html#SECTION00442000000000000000"><SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">4</SPAN>.<SPAN CLASS="arabic">2</SPAN> Special menus</A>
94 <LI><A NAME="tex2html282"
95 HREF="node4.html#SECTION00443000000000000000"><SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">4</SPAN>.<SPAN CLASS="arabic">3</SPAN> Defining context menus</A>
96 <LI><A NAME="tex2html283"
97 HREF="node4.html#SECTION00444000000000000000"><SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">4</SPAN>.<SPAN CLASS="arabic">4</SPAN> Displaying menus</A>
100 <LI><A NAME="tex2html284"
101 HREF="node4.html#SECTION00450000000000000000"><SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">5</SPAN> Winprops</A>
103 <LI><A NAME="tex2html285"
104 HREF="node4.html#SECTION00451000000000000000"><SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">5</SPAN>.<SPAN CLASS="arabic">1</SPAN> Sizehint winprops</A>
105 <LI><A NAME="tex2html286"
106 HREF="node4.html#SECTION00452000000000000000"><SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">5</SPAN>.<SPAN CLASS="arabic">2</SPAN> Classes, roles and instances</A>
107 <LI><A NAME="tex2html287"
108 HREF="node4.html#SECTION00453000000000000000"><SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">5</SPAN>.<SPAN CLASS="arabic">3</SPAN> Finding window identification</A>
109 <LI><A NAME="tex2html288"
110 HREF="node4.html#SECTION00454000000000000000"><SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">5</SPAN>.<SPAN CLASS="arabic">4</SPAN> Some common examples</A>
112 <LI><A NAME="tex2html289"
113 HREF="node4.html#SECTION00454100000000000000"><SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">5</SPAN>.<SPAN CLASS="arabic">4</SPAN>.<SPAN CLASS="arabic">1</SPAN> Acrobat Reader</A>
114 <LI><A NAME="tex2html290"
115 HREF="node4.html#SECTION00454200000000000000"><SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">5</SPAN>.<SPAN CLASS="arabic">4</SPAN>.<SPAN CLASS="arabic">2</SPAN> Fixing a Mozilla Firebird transient</A>
116 <LI><A NAME="tex2html291"
117 HREF="node4.html#SECTION00454300000000000000"><SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">5</SPAN>.<SPAN CLASS="arabic">4</SPAN>.<SPAN CLASS="arabic">3</SPAN> Forcing newly created windows in named frames</A>
119 <!--End of Table of Child-Links-->
122 <H1><A NAME="SECTION00400000000000000000"></A>
123 <A NAME="chap:config"></A>
125 <SPAN CLASS="arabic">3</SPAN>. Basic configuration
129 This chapter should help your configure Ion to your liking. As the your
130 probably already know, Ion uses Lua as a configuration and extension
131 language. If you're new to it, you might first want to read some Lua
132 documentation as already suggested and pointed to in the Introduction
133 before continuing with this chapter.
136 Section <A HREF="#sec:conffiles">3.1</A> is an overview of the multiple configuration
137 files Ion uses and as a perhaps more understandable introduction to the
138 general layout of the configuration files, a walk-through of the main
139 configuration file <SPAN CLASS="textit">ion.lua</SPAN> is provided in section
140 <A HREF="#sec:walkthrough">3.2</A>.
141 How keys and mouse action are bound to functions is described in detail
142 in <A HREF="#sec:bindings">3.3</A> and in section <A HREF="#sec:winprops">3.5</A> winprops are
143 explained. For a reference on exported functions, see section
144 <A HREF="node7.html#sec:exports">6</A>.
148 <H2><A NAME="SECTION00410000000000000000"></A>
149 <A NAME="sec:conffiles"></A>
151 <SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">1</SPAN> The configuration files
155 Ion3, to which document applies, stores its stock configuration files in
156 <SPAN CLASS="textit">/usr/local/etc/ion3/</SPAN> unless you, the OS package maintainer or
157 whoever installed the package on the system has modified the variables
158 <TT>PREFIX</TT><A NAME="590"></A> or
159 <TT>ETCDIR</TT><A NAME="591"></A> in
160 <SPAN CLASS="textit">system.mk</SPAN><A NAME="592"></A> before compiling Ion.
161 In the first case you probably know where to find the files and in
162 the other case the system administrator or the OS package maintainer
163 should have provided documentation to point to the correct location.
164 If these instructions are no help in locating the correct directory,
165 the command <TT>locate cfg_ion.lua</TT> might help provided <TT>updatedb</TT>
166 has been run recently.
169 User configuration files go in <SPAN CLASS="textit">~/.ion3/</SPAN>.
170 Ion always searches the user configuration file directory before the stock
171 configuration file directory for files. Therefore, if you want to change
172 some setting, it is advised against that you modify the stock configuration
173 files in-place as subsequent installs of Ion will restore the stock
174 configuration files. Instead you should always make a copy of the stock
175 file in <SPAN CLASS="textit">~/.ion3/</SPAN> and modify this file. When searching
176 for a file, if no extension or path component is given, compiled <SPAN CLASS="textit">.lc</SPAN>
177 files are attempted before <SPAN CLASS="textit">.lua</SPAN> files.
180 All the configuration files are named <SPAN CLASS="textit">cfg_*.lua</SPAN> with the ''<SPAN CLASS="textit">*</SPAN>''
181 part varying. The configuration file for each module <SPAN CLASS="textit">mod_modname</SPAN> is
182 <SPAN CLASS="textit">cfg_modname.lua</SPAN>, with <SPAN CLASS="textit">modname</SPAN> varying by the module in
183 question. The following table summarises these and other configuration
187 <TABLE CELLPADDING=3 BORDER="1" WIDTH="100%">
188 <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=1>File</TD>
189 <TD ALIGN="LEFT">Description</TD>
191 <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=1><SPAN CLASS="textit">cfg_ion.lua</SPAN></TD>
192 <TD ALIGN="LEFT">The main configuration file</TD>
194 <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=1><SPAN CLASS="textit">cfg_ioncore.lua</SPAN></TD>
195 <TD ALIGN="LEFT">Configuration file for Ion's core library.
196 Most of the bindings and menus are configured here. Bindings that are
197 specific to some module are configured in the module's configuration
198 file. For details, see section <A HREF="#sec:bindings">3.3</A>.</TD>
200 <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=1><SPAN CLASS="textit">cfg_kludges.lua</SPAN></TD>
201 <TD ALIGN="LEFT">Settings to get some applications behave more nicely have been
202 collected here. See section <A HREF="#sec:winprops">3.5</A>.</TD>
204 <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=1><SPAN CLASS="textit">cfg_layouts.lua</SPAN></TD>
205 <TD ALIGN="LEFT">Some workspace layouts are defined here.</TD>
207 <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=1><SPAN CLASS="textit">cfg_tiling.lua</SPAN>
208 <SPAN CLASS="textit">cfg_query.lua</SPAN>
209 <SPAN CLASS="textit">cfg_menu.lua</SPAN>
210 <SPAN CLASS="textit">cfg_dock.lua</SPAN>
211 <SPAN CLASS="textit">cfg_statusbar.lua</SPAN>
213 <TD ALIGN="LEFT">Configuration files for different modules.</TD>
218 Additionally, there's the file <SPAN CLASS="textit">look.lua</SPAN> that configures the
219 drawing engine, but it is covered in chapter <A HREF="node5.html#chap:gr">4</A>.
223 <H2><A NAME="SECTION00420000000000000000"></A>
224 <A NAME="sec:walkthrough"></A>
226 <SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">2</SPAN> A walk through <SPAN CLASS="textit">cfg_ion.lua</SPAN>
230 As already mentioned <SPAN CLASS="textit">cfg_ion.lua</SPAN> is Ion's main configuration
231 file. Some basic 'feel' settings are usually configured there and
232 the necessary modules and other configuration files configuring some
233 more specific aspects of Ion are loaded there. In this section we
234 take a walk through the stock <SPAN CLASS="textit">cfg_ion.lua</SPAN>.
235 Notice that most of the settings are commented-out (<TT>-</TT> is a
236 line comment in Lua) in the actual file, as they're the defaults
240 The first thing one in the file is to set
245 These settings cause most of Ion's key bindings to use <SPAN CLASS="textbf">Mod1</SPAN> as the
246 modifier key. If <TT>ALTMETA</TT> is set, it is used as modifier for the keys
247 that don't normally use a modifier. for details on modifiers and key
248 binding setup in general see section <A HREF="#sec:bindings">3.3</A>.
251 Next we do some basic feel configuration:
262 These two will set the delay between button presses in a double click, and
263 the timeout to quit resize mode in milliseconds.
274 The first of these two settings enables opaque resize mode: in move/resize
275 move frames and other objects mirror you actions immediately. If opaque
276 resize is disabled, a XOR rubber band is shown during the mode instead.
277 This will, unfortunately, cause Ion to also grab the X server and has some
281 There are some other options as well; see the documentation
282 for <A HREF="node7.html#fn:ioncore.set"><TT>ioncore.set</TT></A> for details.
285 As a next step, in the actual <SPAN CLASS="textit">cfg_ion.lua</SPAN> file, we load
286 <SPAN CLASS="textit">cfg_defaults.lua</SPAN>. However, it is merely a conveniency file for
287 doing exactly what we will going through below, and what is commented
288 out in the actual file. If you do not want to load what
289 <SPAN CLASS="textit">cfg_defaults.lua</SPAN> loads, just comment out the corresponding
290 line, and uncomment the lines for the files that you want:
294 --dopath("cfg_defaults")
295 dopath("cfg_ioncore")
296 dopath("cfg_kludges")
297 dopath("cfg_layouts")
301 Most bindings and menus are defined in <SPAN CLASS="textit">cfg_ioncore.lua</SPAN>.
302 Details on making such definitions follow in sections <A HREF="#sec:bindings">3.3</A>
303 and <A HREF="#sec:menus">3.4</A>, respectively.
304 some kludges or ''winprops'' to make some applications behave better
305 under Ion are colledted in <SPAN CLASS="textit">cfg_kludges.lua</SPAN>; see section
306 <A HREF="#sec:winprops">3.5</A> for details. In addition to these, this file
307 lists quite a few statements of the form
309 ioncore.defshortening("[^:]+: (.*)(<[0-9]+>)", "$1$2$|$1$<...$2")
311 These are used to configure how Ion attempts to shorten window titles
312 when they do not fit in a Tab. The first argument is a POSIX regular
313 expression that is used to match against the title and the next is
314 a rule to construct a new title of a match occurs. This particular
315 rule is used to shorten e.g. 'Foo: barbaz<3>' to 'barba...<3>'; for
316 details see the function reference entry for <A HREF="node7.html#fn:ioncore.defshortening"><TT>ioncore.defshortening</TT></A>.
317 Finally, <SPAN CLASS="textit">cfg_layouts.lua</SPAN> defines some workspace layouts, available
318 through the <SPAN CLASS="textbf">F9</SPAN> workspace creation query.
321 To actually be able to do something besides display windows in full screen
322 mode, we must next load some modules:
329 dopath("mod_statusbar")
336 <H2><A NAME="SECTION00430000000000000000"></A>
337 <A NAME="sec:bindings"></A>
339 <SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">3</SPAN> Keys and rodents
343 In the stock configuration file setup, most key and mouse bindings are set
344 from the file <SPAN CLASS="textit">cfg_ioncore.lua</SPAN> while module-specific bindings
345 are set from the modules' main configuration files (<SPAN CLASS="textit">cfg_modname.lua</SPAN>).
346 This, however, does not have to be so as long as the module has been
347 loaded prior to defining any module-specific bindings.
350 Bindings are defined by calling the function
351 <A HREF="node7.html#fn:ioncore.defbindings"><TT>defbindings</TT></A> with the ''context'' of the
352 bindings and the a table of new bindings to make. The context is simply
353 string indicating one of the classes of regions (or modes such as
354 WMoveresMode) introduced in section <A HREF="node3.html#sec:objects">2.2</A>, and fully
355 listed in appendix <A HREF="node9.html#app:fullhierarchy">B</A>, although not all define
356 a binding map. For example, the following skeleton would be used to
357 define new bindings for all frames:
361 defbindings("WFrame", {
362 -- List of bindings to make goes here.
367 There has been some confusion among users about the need to define the
368 ''context'' for each binding, so let me try to explain this design
369 decision here. The thing is that if there was a just a simple 'bind this
370 key to this action' method without knowledge of the context, some
371 limitations would have to be made on the available actions and writing
372 custom handlers would be more complicated. In addition one may want to
373 bind the same function to different key for different types of objects.
374 Indeed, the workspace and frame tab switching functions are the same both
375 classes being based on WMPlex, and in the stock configuration the
376 switch to <SPAN CLASS="MATH"></SPAN>:th workspaces is bound to <SPAN CLASS="textbf">Mod1+n</SPAN> while the switch to
377 <SPAN CLASS="MATH"></SPAN>:th tab is bound to the sequence <SPAN CLASS="textbf">Mod1+k n</SPAN>.
380 Currently known ''contexts'' include:
383 <TT>WMPlex.toplevel</TT>,
385 <TT>WFrame.toplevel</TT>,
386 <TT>WFrame.floating</TT>,
387 <TT>WFrame.tiled</TT>,
388 <TT>WFrame.transient</TT>,
389 <TT>WMoveresMode</TT>,
394 <TT>WTiling</TT>, and
396 Most of these should be self-explanatory, corresponding to objects
397 of class with the same name. The ones with <TT>.toplevel</TT> suffix
398 refer to screens and ''toplevel'' frames, i.e. frames that are
399 not used for transient windows. Likewise <TT>.transient</TT> refers
400 to frames in transient mode, and <TT>.tiled</TT> and <TT>.floating</TT>
401 to frames in, respectively, tiled and floating modes.
404 The following subsections describe how to construct elements of the
405 binding table. Note that <A HREF="node7.html#fn:ioncore.defbindings"><TT>defbindings</TT></A> adds
406 the the newly defined bindings to the previous bindings of the context,
407 overriding duplicates. To unbind an event, set the handler parameter
408 to <TT>nil</TT> for each of the functions to be described in the following
412 Also note that when multiple objects want to handle a binding, the
413 innermost (when the root window is considered the outermost) active object
414 in the parent-child hierarchy (see Figure <A HREF="node3.html#fig:parentship">2.2</A>) of objects
415 gets to handle the action.
419 <H3><A NAME="SECTION00431000000000000000">
420 <SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">1</SPAN> Binding handlers and special variables</A>
424 Unlike in Ion2, in Ion3 binding handlers are not normally passed as
425 ''anonymous functions'', although this is still possible. The preferred
426 method now is to pass the code of the handler as a string. Two special
427 variables are available in this code. These are
430 <TABLE CELLPADDING=3 BORDER="1" WIDTH="100%">
431 <TR><TD ALIGN="LEFT">Variable</TD>
432 <TD ALIGN="LEFT">Description</TD>
434 <TR><TD ALIGN="LEFT"><TT>_</TT> (underscore)</TD>
435 <TD ALIGN="LEFT">Reference to the object on which the
436 binding was triggered. The object is of the same class as the the
437 context of the <A HREF="node7.html#fn:ioncore.defbindings"><TT>defbindings</TT></A> call
438 defining the binding.</TD>
440 <TR><TD ALIGN="LEFT"><TT>_sub</TT></TD>
441 <TD ALIGN="LEFT">Usually, the currently active <SPAN CLASS="textit">managed object</SPAN> of the
442 object referred to by <TT>_</TT>, but sometimes (e.g. mouse actions
443 on tabs of frames) something else relevant to the action triggering
446 <TR><TD ALIGN="LEFT"><TT>_chld</TT></TD>
447 <TD ALIGN="LEFT">Object corresponding to the currently active child window of the
448 object referred to by <TT>_</TT>.</TD>
453 For example, supposing '<TT>_</TT>' is a WFrame, the following
454 handler should move the active window to the right, if possible:
463 <H3><A NAME="SECTION00432000000000000000">
464 <SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">2</SPAN> Guards</A>
468 To suppress error messages, each binding handler may also be accompanied
469 by a ''guard'' expression that blocks the handler from being called when
470 the guard condition is not met. Currently the following guard expressions
471 are supported (for both <TT>_sub</TT> and <TT>_chld</TT>):
474 <TABLE CELLPADDING=3 BORDER="1" WIDTH="100%">
475 <TR><TD ALIGN="LEFT">Guard</TD>
476 <TD ALIGN="LEFT">Description</TD>
478 <TR><TD ALIGN="LEFT"><TT>"_sub:non-nil"</TT></TD>
479 <TD ALIGN="LEFT">The <TT>_sub</TT> parameter must be set.</TD>
481 <TR><TD ALIGN="LEFT"><TT>"_sub:SomeClass"</TT></TD>
482 <TD ALIGN="LEFT">The <TT>_sub</TT> parameter must be member
483 of class SomeClass.</TD>
489 <H3><A NAME="SECTION00433000000000000000"></A>
490 <A NAME="sec:binddef"></A>
492 <SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">3</SPAN> Defining the bindings
496 The descriptions of the individual bindings in the binding table argument
497 to <A HREF="node7.html#fn:ioncore.defbindings"><TT>defbindings</TT></A> should be constructed with the following
504 <LI><A HREF="#fn:kpress"><TT>kpress</TT></A><TT>(keyspec, handler [, guard])</TT>,
506 <LI><A HREF="#fn:kpress_wait"><TT>kpress_wait</TT></A><TT>(keyspec, handler [, guard])</TT> and
508 <LI><A HREF="#fn:submap"><TT>submap</TT></A><TT>(keyspec, { ... more key bindings ... })</TT>.
514 <LI><A HREF="#fn:mclick"><TT>mclick</TT></A><TT>(buttonspec, handler [, guard])</TT>,
516 <LI><A HREF="#fn:mdblclick"><TT>mdblclick</TT></A><TT>(buttonspec, handler [, guard])</TT>,
518 <LI><A HREF="#fn:mpress"><TT>mpress</TT></A><TT>(buttonspec, handler [, guard])</TT> and
520 <LI><A HREF="#fn:mdrag"><TT>mdrag</TT></A><TT>(buttonspec, handler [, guard])</TT>.
525 The actions that most of these functions correspond to should be clear
526 and as explained in the reference, <A HREF="#fn:kpress_wait"><TT>kpress_wait</TT></A> is simply
527 <A HREF="#fn:kpress"><TT>kpress</TT></A> with a flag set instructing Ioncore wait for all
528 modifiers to be released before processing any further actions.
529 This is to stop one from accidentally calling e.g.
530 <A HREF="node7.html#fn:WRegion.rqclose"><TT>WRegion.rqclose</TT></A> multiple times in a row. The <A HREF="#fn:submap"><TT>submap</TT></A>
531 function is used to define submaps or ''prefix maps''. The second
532 argument to this function is table listing the key press actions
533 (<A HREF="#fn:kpress"><TT>kpress</TT></A>) in the submap
536 The parameters <TT>keyspec</TT> and <TT>buttonspec</TT> are explained below
537 in detail. The parameter <TT>handler</TT> is the handler for the binding,
538 and the optional parameter <TT>guard</TT> its guard. These should normally
539 be strings as explained above.
543 <H3><A NAME="SECTION00434000000000000000">
544 <SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">4</SPAN> Examples</A>
548 For example, to just bind the key <SPAN CLASS="textbf">Mod1+1</SPAN> to switch to the first
549 workspace and <SPAN CLASS="textbf">Mod1+Right</SPAN> to the next workspace, you would make the
552 defbindings("WScreen", {
553 kpress("Mod1+Right", "_:switch_next()"),
554 kpress("Mod1+1", "_:switch_nth(1)"),
559 Note that <TT>_:switch_nth(1)</TT> is the same as calling
560 <A HREF="node7.html#fn:WMPlex.switch_next"><TT>WMPlex.switch_next</TT></A><TT>(_, 1)</TT> as WScreen inherits
561 WMPlex and this is where the function is actually defined.
564 Similarly to the above example, to bind the key sequence <SPAN CLASS="textbf">Mod1+k n</SPAN>
565 switch to the next managed object within a frame, and <SPAN CLASS="textbf">Mod1+k 1</SPAN> to the
566 first, you would issue the following call:
568 defbindings("WFrame", {
570 kpress("Right", "_:switch_next()"),
571 kpress("1", "_:switch_nth(1)"),
578 <H3><A NAME="SECTION00435000000000000000">
579 <SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">5</SPAN> Key specifications</A>
583 As seen above, the functions that create key binding specifications require
584 a <TT>keyspec</TT> argument. This argument should be a string containing the
585 name of a key as listed in the X header file <SPAN CLASS="textit">keysymdef.h</SPAN><A NAME="tex2html7"
586 HREF="#foot871"><SUP><SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">1</SPAN></SUP></A> without the <TT>XK_</TT> prefix.
588 Most of the key names are quite intuitive while some are not. For example,
589 the <SPAN CLASS="textbf">Enter</SPAN> key on the main part of the keyboard has the less common
590 name <SPAN CLASS="textbf">Return</SPAN> while the one the numpad is called <SPAN CLASS="textbf">KP_Enter</SPAN>.
593 The <TT>keyspec</TT> string may optionally have multiple ''modifier'' names
594 followed by a plus sign (<TT>+</TT>) as a prefix. X defines the following
597 <SPAN CLASS="textbf">Shift</SPAN>, <SPAN CLASS="textbf">Control</SPAN>, <SPAN CLASS="textbf">Mod1</SPAN> to <SPAN CLASS="textbf">Mod5</SPAN>,
598 <SPAN CLASS="textbf">AnyModifier</SPAN> and <SPAN CLASS="textbf">Lock</SPAN>.
608 X allows binding all of these modifiers to almost any key and while this
609 list of modifiers does not explicitly list keys such as
610 <SPAN CLASS="textbf">Alt</SPAN><A NAME="878"></A> that are common on modern keyboards, such
611 keys are bound to one of the <SPAN CLASS="textbf">ModN</SPAN>. On systems running XFree86
612 <SPAN CLASS="textbf">Alt</SPAN> is usually <SPAN CLASS="textbf">Mod1</SPAN>. On Suns <SPAN CLASS="textbf">Mod1</SPAN> is the diamond key
613 and <SPAN CLASS="textbf">Alt</SPAN> something else. One of the ''flying window'' keys on so
614 called Windows-keyboards is probably mapped to <SPAN CLASS="textbf">Mod3</SPAN> if you have
615 such a key. Use the program <SPAN CLASS="textit">xmodmap</SPAN><A NAME="879"></A>
616 to find out what exactly is bound where.
619 Ion defaults to <SPAN CLASS="textbf">AnyModifier</SPAN> in submaps. This can sometimes lead to
620 unwanted effects when the same key is used with and without explicitly
621 specified modifiers in nested regions. For this reason, Ion recognises
622 <SPAN CLASS="textbf">NoModifier</SPAN> as a special modifier that can be used to reset this
626 Ion ignores the <SPAN CLASS="textbf">Lock</SPAN> modifier and any <SPAN CLASS="textbf">ModN</SPAN> (<SPAN CLASS="MATH"></SPAN>)
627 bound to <SPAN CLASS="textbf">NumLock</SPAN><A NAME="880"></A> or
628 <SPAN CLASS="textbf">ScrollLock</SPAN><A NAME="881"></A>
629 by default because such<A NAME="tex2html8"
630 HREF="#foot850"><SUP><SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">2</SPAN></SUP></A> locking keys may otherwise
635 <H3><A NAME="SECTION00436000000000000000">
636 <SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">6</SPAN> Button specifications</A>
640 Button specifications are similar to key definitions but now
641 instead of specifying modifiers and a key, you specify modifiers
642 and one of the button names <SPAN CLASS="textbf">Button1</SPAN> to
643 <SPAN CLASS="textbf">Button5</SPAN><A NAME="882"></A>. Additionally the
644 specification may end with an optional area name following an @-sign.
645 Only frames currently support areas, and the supported values in this
647 <TT>"border"</TT>, <TT>"tab"</TT>, <TT>"empty_tab"</TT>, <TT>"client"</TT> and
648 <TT>nil</TT> (for the whole frame).
651 For example, the following code binds dragging a tab with the first
652 button pressed to initiate tab drag&drop handling:
656 defbindings("WFrame", {
657 mdrag("Button1@tab", "_:p_tabdrag()"),
663 <H3><A NAME="SECTION00437000000000000000">
664 <SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">7</SPAN> A further note on the default binding configuration</A>
668 The default binding configuration contains references to the variables
669 <TT>META</TT> and <TT>ALTMETA</TT> instead of directly using the default
670 values of <TT>"Mod1+"</TT> and <TT>""</TT> (nothing). As explained in
671 section <A HREF="#sec:walkthrough">3.2</A>, the definitions of these variables
672 appear in <SPAN CLASS="textit">cfg_ion.lua</SPAN>. This way you can easily change the the
673 modifiers used by all bindings in the default configuration without
674 changing the whole binding configuration. Quite a few people prefer
675 to use the Windows keys as modifiers because many applications already
676 use <SPAN CLASS="textbf">Alt</SPAN>. Nevertheless, <SPAN CLASS="textbf">Mod1</SPAN> is the default as a key bound
677 to it is available virtually everywhere.
681 <H2><A NAME="SECTION00440000000000000000"></A>
682 <A NAME="sec:menus"></A>
684 <SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">4</SPAN> Menus
689 <H3><A NAME="SECTION00441000000000000000">
690 <SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">4</SPAN>.<SPAN CLASS="arabic">1</SPAN> Defining menus</A>
698 In the stock configuration file setup, menus are defined in the file
699 <SPAN CLASS="textit">cfg_menus.lua</SPAN> as previously mentioned. The <SPAN CLASS="textit">mod_menu</SPAN> module
700 must be loaded for one to be able to define menus, and this is done with
701 the function <A HREF="#fn:mod_menu.defmenu"><TT>defmenu</TT></A> provided by it.
704 Here's an example of the definition of a rather simple menu with a submenu:
708 defmenu("exitmenu", {
709 menuentry("Restart", "ioncore.restart()"),
710 menuentry("Exit", "ioncore.shutdown()"),
713 defmenu("mainmenu", {
714 menuentry("Lock screen", "ioncore.exec('xlock')"),
715 menuentry("Help", "mod_query.query_man(_)"),
716 submenu("Exit", "exitmenu"),
721 The <A HREF="#fn:mod_menu.menuentry"><TT>menuentry</TT></A> function is used to create an entry in the
722 menu with a title and an entry handler to be called when the menu entry
723 is activated. The parameters to the handler are similar to those of binding
724 handlers, and usually the same as those of the binding that opened the menu.
727 The <A HREF="#fn:mod_menu.submenu"><TT>submenu</TT></A> function is used to insert a submenu at that
728 point in the menu. (One could as well just pass a table with the menu
729 entries, but it is not encouraged.)
733 <H3><A NAME="SECTION00442000000000000000">
734 <SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">4</SPAN>.<SPAN CLASS="arabic">2</SPAN> Special menus</A>
738 The menu module predefines the following special menus. These can be used
739 just like the menus defined as above.
742 <TABLE CELLPADDING=3 BORDER="1" WIDTH="100%">
743 <TR><TD ALIGN="LEFT">Menu name</TD>
744 <TD ALIGN="LEFT">Description</TD>
746 <TR><TD ALIGN="LEFT"><TT>windowlist</TT></TD>
747 <TD ALIGN="LEFT">List of all client windows. Activating an entry jumps to that window.</TD>
749 <TR><TD ALIGN="LEFT"><TT>workspacelist</TT></TD>
750 <TD ALIGN="LEFT">List of all workspaces. Activating an entry jumps to that workspaces.</TD>
752 <TR><TD ALIGN="LEFT"><TT>focuslist</TT></TD>
753 <TD ALIGN="LEFT">List of client windows with recent activity in them, followed by
754 previously focused client windows.</TD>
756 <TR><TD ALIGN="LEFT"><TT>focuslist_</TT></TD>
757 <TD ALIGN="LEFT">List of previously focused client windows.</TD>
759 <TR><TD ALIGN="LEFT"><TT>stylemenu</TT></TD>
760 <TD ALIGN="LEFT">List of available <SPAN CLASS="textit">look_*.lua</SPAN> style files. Activating an entry
761 loads that style and ask to save the selection.</TD>
763 <TR><TD ALIGN="LEFT"><TT>ctxmenu</TT></TD>
764 <TD ALIGN="LEFT">Context menu for given object.</TD>
770 <H3><A NAME="SECTION00443000000000000000">
771 <SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">4</SPAN>.<SPAN CLASS="arabic">3</SPAN> Defining context menus</A>
775 The ''ctxmenu'' is a special menu that is assembled from a defined context
776 menu for the object for which the menu was opened for, but also includes
777 the context menus for the manager objects as submenus.
780 Context menus for a given region class are defined with the
781 <A HREF="#fn:mod_menu.defctxmenu"><TT>defctxmenu</TT></A> function. This is other ways similar to
782 <A HREF="#fn:mod_menu.defmenu"><TT>defmenu</TT></A>, but the first argument instead being the name
783 of the menu, the name of the region class to define context menu for.
784 For example, here's part of the stock WFrame context menu
789 defctxmenu("WFrame", {
790 menuentry("Close", "WRegion.rqclose_propagate(_, _sub)"),
791 menuentry("Kill", "WClientWin.kill(_sub)", "_sub:WClientWin"),
796 Some of the same ''modes'' as were available for some bindings
797 may also be used: <TT>WFrame.tiled</TT>, <TT>WFrame.floating</TT>,
798 and <TT>WFrame.transient</TT>.
802 <H3><A NAME="SECTION00444000000000000000"></A>
803 <A NAME="sec:menudisp"></A>
805 <SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">4</SPAN>.<SPAN CLASS="arabic">4</SPAN> Displaying menus
809 The following functions may be used to display menus from binding
810 handlers (and elsewhere):
813 <TABLE CELLPADDING=3 BORDER="1" WIDTH="100%">
814 <TR><TD ALIGN="LEFT">Function</TD>
815 <TD ALIGN="LEFT">Description</TD>
817 <TR><TD ALIGN="LEFT"><A HREF="node7.html#fn:mod_menu.menu"><TT>mod_menu.menu</TT></A></TD>
818 <TD ALIGN="LEFT">Keyboard (or mouse) operated menus that open in the bottom-left corner
819 of a screen or frame.</TD>
821 <TR><TD ALIGN="LEFT"><A HREF="#fn:mod_menu.bigmenu"><TT>mod_menu.bigmenu</TT></A></TD>
822 <TD ALIGN="LEFT">Same as previous, but uses another graphical style.</TD>
824 <TR><TD ALIGN="LEFT"><A HREF="node7.html#fn:mod_menu.pmenu"><TT>mod_menu.pmenu</TT></A></TD>
825 <TD ALIGN="LEFT">Mouse-operated drop-down menus. This function can only be called from a
826 mouse press or drag handler.</TD>
828 <TR><TD ALIGN="LEFT"><A HREF="node7.html#fn:mod_menu.grabmenu"><TT>mod_menu.grabmenu</TT></A></TD>
829 <TD ALIGN="LEFT">A special version of <A HREF="node7.html#fn:mod_menu.menu"><TT>mod_menu.menu</TT></A> that grabs the keyboard
830 and is scrolled with a given key until all modifiers have been released,
831 after which the selected entry is activated. This function is meant to
832 be used for implementing, for example, Win***s-style <SPAN CLASS="textbf">Alt-Tab</SPAN>
833 handling.<A NAME="tex2html9"
834 HREF="#foot1188"><SUP><SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">3</SPAN></SUP></A></TD>
839 The <A HREF="node7.html#fn:mod_menu.grabmenu"><TT>grabmenu</TT></A> function takes the extra key parameter, but
840 aside from that each of these functions takes three arguments, which when
841 called from a binding handler, should be the parameters to the handler, and
842 the name of the menu. For example, the following snippet of of code binds
843 the both ways to open a context menu for a frame:
847 defbindings("WFrame", {
848 kpress(MOD1.."M", "mod_menu.menu(_, _sub, 'ctxmenu')"),
849 mpress("Button3", "mod_menu.pmenu(_, _sub, 'ctxmenu')"),
855 <H2><A NAME="SECTION00450000000000000000"></A>
856 <A NAME="sec:winprops"></A>
858 <SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">5</SPAN> Winprops
862 The so-called ''winprops''<A NAME="1283"></A> can be used to change how
863 specific windows are handled and to set up some kludges to deal with
864 badly behaving applications. They are defined by calling the function
865 <TT>defwinprop</TT> with a table containing the properties to set and the
866 necessary information to identify a window. The currently supported
867 winprops are listed below, and the subsequent subsections explain the
868 usual method of identifying windows, and how to obtain this information.
875 <DT><STRONG>Winprop:</STRONG></DT>
876 <DD><TT>acrobatic</TT> (boolean)
879 <DT><STRONG>Description:</STRONG></DT>
880 <DD><A NAME="1438"></A>
881 Set this to <TT>true</TT> for Acrobat Reader. It has an annoying
882 habit of trying to manage its dialogs instead of setting them as
883 transients and letting the window manager do its job, causing
884 Ion and acrobat go a window-switching loop when a dialog is
893 <DT><STRONG>Winprop:</STRONG></DT>
894 <DD><TT>float</TT> (boolean)
897 <DT><STRONG>Description:</STRONG></DT>
898 <DD><A NAME="1439"></A>
899 Set this to open the window in a floating frame, when
908 <DT><STRONG>Winprop:</STRONG></DT>
909 <DD><TT>fullscreen</TT> (boolean)
912 <DT><STRONG>Description:</STRONG></DT>
913 <DD><A NAME="1440"></A>
914 Should the window be initially in full screen mode?
922 <DT><STRONG>Winprop:</STRONG></DT>
923 <DD><TT>ignore_cfgrq</TT> (boolean)
926 <DT><STRONG>Description:</STRONG></DT>
927 <DD><A NAME="1441"></A>
928 Should configure requests on the window be ignored?
929 Only has effect on floating windows.
937 <DT><STRONG>Winprop:</STRONG></DT>
938 <DD><TT>ignore_net_active_window</TT> (boolean)
941 <DT><STRONG>Description:</STRONG></DT>
942 <DD><A NAME="1442"></A>
943 Ignore extended WM hints <TT>_NET_ACTIVE_WINDOW</TT> request.
951 <DT><STRONG>Winprop:</STRONG></DT>
952 <DD><TT>jumpto</TT> (boolean)
955 <DT><STRONG>Description:</STRONG></DT>
956 <DD><A NAME="1443"></A>
957 Should a newly created client window always be made
958 active, even if the allocated frame isn't.
966 <DT><STRONG>Winprop:</STRONG></DT>
967 <DD><TT>new_group</TT> (string)
970 <DT><STRONG>Description:</STRONG></DT>
971 <DD><A NAME="1444"></A>
972 If the region specified by <TT>target</TT> winprop does not exist
973 (or that winprop is not set), create a new workspace using the
974 previously stored layout (see <A HREF="node7.html#fn:ioncore.deflayout"><TT>ioncore.deflayout</TT></A>) named by
975 this property. After creating the workspace, <TT>target</TT> is
976 attempted to be found again. (If that still fails, the newly
977 created workspace is still asked to manage the client window.)
985 <DT><STRONG>Winprop:</STRONG></DT>
986 <DD><TT>oneshot</TT> (boolean)
989 <DT><STRONG>Description:</STRONG></DT>
990 <DD><A NAME="1445"></A>
991 Discard this winprop after first use.
999 <DT><STRONG>Winprop:</STRONG></DT>
1000 <DD><TT>statusbar</TT> (string)
1003 <DT><STRONG>Description:</STRONG></DT>
1004 <DD><A NAME="1446"></A>
1005 Put the window in the statusbar, in the named tray component,
1006 (The default tray component is called simply <TT>"systray"</TT>,
1007 and others you give names to in your custom template, always
1008 prefixed by <TT>"systray_"</TT>.
1016 <DT><STRONG>Winprop:</STRONG></DT>
1017 <DD><TT>switchto</TT> (boolean)
1020 <DT><STRONG>Description:</STRONG></DT>
1021 <DD><A NAME="1447"></A>
1022 Should a newly mapped client window be switched to within
1031 <DT><STRONG>Winprop:</STRONG></DT>
1032 <DD><TT>target</TT> (string)
1035 <DT><STRONG>Description:</STRONG></DT>
1036 <DD><A NAME="1448"></A>
1037 The name of an object (workspace, frame) that should manage
1038 windows of this type. See also <TT>new_group</TT>.
1046 <DT><STRONG>Winprop:</STRONG></DT>
1047 <DD><TT>transient_mode</TT> (string)
1050 <DT><STRONG>Description:</STRONG></DT>
1051 <DD><A NAME="1449"></A>
1052 <TT>"normal"</TT>: No change in behaviour. <TT>"current"</TT>:
1053 The window should be thought of as a transient for the current
1054 active client window (if any) even if it is not marked as a
1055 transient by the application. <TT>"off"</TT>: The window should
1056 be handled as a normal window even if it is marked as a
1057 transient by the application.
1065 <DT><STRONG>Winprop:</STRONG></DT>
1066 <DD><TT>transparent</TT> (boolean)
1069 <DT><STRONG>Description:</STRONG></DT>
1070 <DD><A NAME="1450"></A>
1071 Should frames be made transparent when this window is selected?
1079 <H3><A NAME="SECTION00451000000000000000">
1080 <SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">5</SPAN>.<SPAN CLASS="arabic">1</SPAN> Sizehint winprops</A>
1084 Additionally, the winprops
1085 <TT>max_size</TT><A NAME="1451"></A>,
1086 <TT>min_size</TT><A NAME="1452"></A>,
1087 <TT>aspect</TT><A NAME="1453"></A>,
1088 <TT>resizeinc</TT><A NAME="1454"></A>,
1090 <TT>ignore_max_size</TT><A NAME="1455"></A>,
1091 <TT>ignore_min_size</TT><A NAME="1456"></A>,
1092 <TT>ignore_aspect</TT><A NAME="1457"></A>,
1093 <TT>ignore_resizeinc</TT><A NAME="1458"></A>,
1094 may be used to override application-supplied size hints. The four
1095 first ones are tables with the fields <TT>w</TT> and <TT>h</TT>, indicating
1096 the width and height size hints in pixels, and the latter ignore
1097 winprop is a boolean.
1100 Finally, the boolean
1101 <TT>userpos</TT><A NAME="1459"></A> option may be used to
1102 override the <TT>USPosition</TT> flag of the size hints. Normally,
1103 when this flag is set, Ion tries to respect the supplied window
1104 position more than when it is not set. Obviously, this makes sense
1105 only for floating windows.
1109 <H3><A NAME="SECTION00452000000000000000"></A>
1110 <A NAME="sec:classesrolesinstances"></A>
1112 <SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">5</SPAN>.<SPAN CLASS="arabic">2</SPAN> Classes, roles and instances
1116 The identification information in the winprop specification is usually the
1117 <TT>class</TT><A NAME="1460"></A>,
1118 <TT>role</TT><A NAME="1461"></A>,
1119 <TT>instance</TT><A NAME="1462"></A> and
1121 of the window. The <TT>name</TT> field is a Lua-style regular expression
1122 matched against the window's title and the rest are strings that must
1123 exactly match the corresponding window information. It is not necessary
1124 to specify all of these fields.
1127 Ion looks for a matching winprop in the order listed by the following
1128 table. An 'E' indicates that the field must be set in the winprop
1129 and it must match the window's corresponding property exactly or, in
1130 case of <TT>name</TT>, the regular expression must match the window
1131 title. An asterisk '*' indicates that a winprop where the field is
1132 not specified (or is itself an asterisk in case of the first three
1136 <DIV ALIGN="CENTER">
1137 <TABLE CELLPADDING=3 BORDER="1">
1138 <TR><TD ALIGN="LEFT"><TT>class</TT></TD>
1139 <TD ALIGN="LEFT"><TT>role</TT></TD>
1140 <TD ALIGN="LEFT"><TT>instance</TT></TD>
1141 <TD ALIGN="LEFT"><TT>name</TT></TD>
1143 <TR><TD ALIGN="LEFT">E</TD>
1144 <TD ALIGN="LEFT">E</TD>
1145 <TD ALIGN="LEFT">E</TD>
1146 <TD ALIGN="LEFT">E</TD>
1148 <TR><TD ALIGN="LEFT">E</TD>
1149 <TD ALIGN="LEFT">E</TD>
1150 <TD ALIGN="LEFT">E</TD>
1151 <TD ALIGN="LEFT">*</TD>
1153 <TR><TD ALIGN="LEFT">E</TD>
1154 <TD ALIGN="LEFT">E</TD>
1155 <TD ALIGN="LEFT">*</TD>
1156 <TD ALIGN="LEFT">E</TD>
1158 <TR><TD ALIGN="LEFT">E</TD>
1159 <TD ALIGN="LEFT">E</TD>
1160 <TD ALIGN="LEFT">*</TD>
1161 <TD ALIGN="LEFT">*</TD>
1163 <TR><TD ALIGN="LEFT">E</TD>
1164 <TD ALIGN="LEFT">*</TD>
1165 <TD ALIGN="LEFT">E</TD>
1166 <TD ALIGN="LEFT">E</TD>
1168 <TR><TD ALIGN="LEFT">E</TD>
1169 <TD ALIGN="LEFT">*</TD>
1170 <TD ALIGN="LEFT">E</TD>
1171 <TD ALIGN="LEFT">*</TD>
1173 <TR><TD ALIGN="LEFT">E</TD>
1174 <TD ALIGN="LEFT">*</TD>
1175 <TD ALIGN="LEFT">*</TD>
1176 <TD ALIGN="LEFT">E</TD>
1178 <TR><TD ALIGN="LEFT"> </TD>
1179 <TD ALIGN="LEFT"> </TD>
1180 <TD ALIGN="LEFT"> </TD>
1181 <TD ALIGN="LEFT">etc.</TD>
1187 If there are multiple winprops with other identification information
1188 the same but different <TT>name</TT>, the longest match is chosen.
1192 <H3><A NAME="SECTION00453000000000000000">
1193 <SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">5</SPAN>.<SPAN CLASS="arabic">3</SPAN> Finding window identification</A>
1197 The 'Window info' context menu entry (<SPAN CLASS="textbf">Mod1+M</SPAN> or <SPAN CLASS="textbf">Button3</SPAN> on a tab)
1198 can be used to list the identification information required to set winprops
1199 for a window and all the transient windows managed within it.
1203 Another way to get the identification information is to use <TT>xprop</TT>.
1204 Simply run To get class and instance, simply run <TT>xprop WM_CLASS</TT>
1205 and click on the particular window of interest. The class is the latter of
1206 the strings while the instance is the former. To get the role - few
1207 windows have this property - use the command <TT>xprop WM_ROLE</TT>.
1208 This method, however, will not work on transients.
1212 So-called ''transient windows'' are usually short-lived dialogs (although
1213 some programs abuse this property) that have a parent window that they are
1214 ''transient for''. On tiled workspaces Ion displays these windows
1215 simulatenously with the parent window at the bottom of the same frame.
1216 Unfortunately <TT>xprop</TT> is stupid and can't cope with this situation,
1217 returning the parent window's properties when the transient is clicked on.
1218 For this reason you'll have to do a little extra work to get the properties
1219 for that window.<A NAME="tex2html11"
1220 HREF="#foot1464"><SUP><SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">4</SPAN></SUP></A>
1222 Finally, it should be mentioned that too many authors these days
1223 ''forget'' to set this vital identification to anything meaningful:
1224 everything except name is the same for all of the programs's
1225 windows, for example.
1229 <H3><A NAME="SECTION00454000000000000000">
1230 <SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">5</SPAN>.<SPAN CLASS="arabic">4</SPAN> Some common examples</A>
1235 <H4><A NAME="SECTION00454100000000000000">
1236 <SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">5</SPAN>.<SPAN CLASS="arabic">4</SPAN>.<SPAN CLASS="arabic">1</SPAN> Acrobat Reader</A>
1240 The following is absolutely necessary for Acrobat reader:
1246 instance = "documentShell",
1253 <H4><A NAME="SECTION00454200000000000000">
1254 <SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">5</SPAN>.<SPAN CLASS="arabic">4</SPAN>.<SPAN CLASS="arabic">2</SPAN> Fixing a Mozilla Firebird transient</A>
1258 Mozilla Firebird (0.7) incorrectly does not set the <TT>WM_TRANSIENT_FOR</TT>
1259 property for the dialog that is used to ask the action to take for a file.
1260 It, however, sets the the property point to the main window for the save
1261 dialog. This can be annoying and confusing, as the first dialog is not
1262 closed before the second is displayed.
1265 We'd like the first dialog to be transient to the main window. The closest
1266 we can get to that is to consider it transient to the current window (if
1267 there's one). Unfortunately Firebird does not set any meaningful classes,
1268 instances or roles for the windows, so we'll have to rely on an ugly title
1274 class = "MozillaFirebird-bin",
1275 name = "Opening .*",
1276 transient_mode = "current",
1282 <H4><A NAME="SECTION00454300000000000000">
1283 <SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">5</SPAN>.<SPAN CLASS="arabic">4</SPAN>.<SPAN CLASS="arabic">3</SPAN> Forcing newly created windows in named frames</A>
1287 The following winprop should place xterm started with command-line parameter
1288 <TT>-name sysmon</TT> and running a system monitoring program in a
1293 instance = "sysmon",
1294 target = "sysmonframe",
1299 For this example to work, we have to somehow create a frame named
1300 <TT>sysmonframe</TT>. One way to do this is to make the following
1301 call in the <SPAN CLASS="textbf">Mod1+F3</SPAN> Lua code query:
1305 mod_query.query_renameframe(_)
1309 Recall that <TT>_</TT> points to the multiplexer (frame or screen) in which
1310 the query was opened. Running this code should open a new query prefilled
1311 with the current name of the frame. In our example we would change the
1312 name to <TT>sysmonframe</TT>, but we could just as well have used the
1313 default name formed from the frame's class name and an instance number.
1318 <BR><HR><H4>Footnotes</H4>
1320 <DT><A NAME="foot871">...keysymdef.h</A><A
1321 HREF="node4.html#tex2html7"><SUP><SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">1</SPAN></SUP></A></DT>
1322 <DD>This file can usually be found in the directory
1323 <SPAN CLASS="textit">/usr/X11R6/include/X11/</SPAN>.
1326 <DT><A NAME="foot850">... such</A><A
1327 HREF="node4.html#tex2html8"><SUP><SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">2</SPAN></SUP></A></DT>
1328 <DD>Completely useless keys that should be
1329 gotten rid of in the author's opinion.
1332 <DT><A NAME="foot1188">... handling.</A><A
1333 HREF="node4.html#tex2html9"><SUP><SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">3</SPAN></SUP></A></DT>
1334 <DD>See the <SPAN CLASS="textit">wcirculate.lua</SPAN> script in the Ion
1335 scripts repository <TT><A NAME="tex2html10"
1336 HREF="http://iki.fi/tuomov/repos/ion-scripts-3/">http://iki.fi/tuomov/repos/ion-scripts-3/</A></TT>.
1339 <DT><A NAME="foot1464">... window.</A><A
1340 HREF="node4.html#tex2html11"><SUP><SPAN CLASS="arabic">3</SPAN>.<SPAN CLASS="arabic">4</SPAN></SUP></A></DT>
1341 <DD>There's a patch to <TT>xprop</TT> to
1342 fix this, but nothing seems to be happening with respect to including it in
1347 <DIV CLASS="navigation"><HR>
1348 <!--Navigation Panel-->
1349 <A NAME="tex2html267"
1351 <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
1352 <A NAME="tex2html261"
1353 HREF="ionconf.html">
1354 <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
1355 <A NAME="tex2html255"
1357 <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
1358 <A NAME="tex2html263"
1360 <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>
1361 <A NAME="tex2html265"
1363 <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A>
1365 <B> Next:</B> <A NAME="tex2html268"
1366 HREF="node5.html">4. Graphical styles</A>
1367 <B> Up:</B> <A NAME="tex2html262"
1368 HREF="ionconf.html">Configuring and extending Ion3</A>
1369 <B> Previous:</B> <A NAME="tex2html256"
1370 HREF="node3.html">2. Preliminaries: Key concepts</A>
1371 <B> <A NAME="tex2html264"
1372 HREF="node1.html">Contents</A></B>
1373 <B> <A NAME="tex2html266"
1374 HREF="node11.html">Index</A></B> </DIV>
1375 <!--End of Navigation Panel-->