Previous Up Next

6  Function reference

6.1  Functions defined in ioncore

Synopsis:
ioncore.TR(s, ...)
Description:
gettext+string.format
Synopsis:
ioncore.bdoc(text)
Description:
Used to enter documentation among bindings so that other programs can read it. Does nothing.
Synopsis:
ioncore.chdir_for(reg, dir)
Description:
Change default working directory for new programs started in reg.
Synopsis:
ioncore.compile_cmd(cmd, guard)
Description:
Compile string cmd into a bindable function. Within cmd, the variable ”_” (underscore) can be used to refer to the object that was selecting for the bound action and chosen to handle it. The variable ”_sub” refers to a ”currently active” sub-object of _, or a sub-object where the action loading to the binding being called actually occured.

The string guard maybe set to pose limits on _sub. Currently supported guards are _sub:non-nil and _sub:WFoobar, where WFoobar is a class.
Synopsis:
ioncore.create_ws(scr, ws_type)
Description:
Create new workspace on screen scr. If ws_type is set, then a workspace of that type is created. Otherwise workspace type is taken from the default_ws_type setting returned by ioncore.get.
Synopsis:
ioncore.defbindings(context, bindings)
Description:
Define bindings for context context. Here binding is a table composed of entries created with ioncore.kpress, etc.; see section 3.3 for details.
Synopsis:
ioncore.defctxmenu(ctx, tab)
Description:
Define context menu for context ctx, tab being a table of menu entries.
Synopsis:
ioncore.defmenu(name, tab)
Description:
Define a new menu with name being the menu's name and tab being a table of menu entries.
Synopsis:
ioncore.defwinprop(list)
Description:
Define a winprop. For more information, see section 3.5.
Synopsis:
ioncore.exec_on(reg, cmd, merr_internal)
Description:
Run cmd with the environment variable DISPLAY set to point to the root window of the X screen reg is on. If cmd is prefixed by a colon (:), the following command is executed in an xterm (or other terminal emulator) with the help of the ion-runinxterm script. If the command is prefixed by two colons, ion-runinxterm will ask you to press enter after the command is finished, even if it returns succesfully.
Synopsis:
table ioncore.read_savefile(string basename)
Description:
Read a savefile.
Synopsis:
string ioncore.get_savefile(string basename)
Description:
Get a file name to save (session) data in. The string basename should contain no path or extension components.
Synopsis:
string ioncore.lookup_script(string file, string sp)
Description:
Lookup script file. If try_in_dir is set, it is tried before the standard search path.
Synopsis:
bool ioncore.write_savefile(string basename, table tab)
Description:
Write tab in file with basename basename in the session directory.
Synopsis:
ioncore.find_manager(obj, t)
Description:
Find an object with type name t managing obj or one of its managers.
Synopsis:
ioncore.get_dir_for(reg)
Description:
Get default working directory for new programs started in reg.
Synopsis:
ioncore.getbindings(maybe_context)
Description:
Get a table of all bindings.
Synopsis:
ioncore.getctxmenu(name)
Description:
Returns a context menu defined with ioncore.defctxmenu.
Synopsis:
ioncore.getmenu(name)
Description:
Returns a menu defined with ioncore.defmenu.
Synopsis:
ioncore.getwinprop(cwin)
Description:
Find winprop table for cwin.
Synopsis:
string ioncore.aboutmsg()
Description:
Returns an about message (version, author, copyright notice).
Synopsis:
void ioncore.clear_tags()
Description:
Untag all regions.
Synopsis:
table ioncore.clientwin_list()
Description:
Return a list of all client windows.
Synopsis:
WRegion ioncore.current()
Description:
Returns the currently focused region, if any.
Synopsis:
bool ioncore.defshortening(string rx, string rule, bool always)
Description:
Add a rule describing how too long titles should be shortened to fit in tabs. The regular expression rx (POSIX, not Lua!) is used to match titles and when rx matches, rule is attempted to use as a replacement for title. If always is set, the rule is used even if no shortening is necessary.

Similarly to sed's 's' command, rule may contain characters that are inserted in the resulting string and specials as follows:
Special Description
$0 Place the original string here.
$1 to $9 Insert n:th capture here (as usual,captures are surrounded by parentheses in the regex).
$| Alternative shortening separator. The shortening described before the first this kind of separator is tried first and if it fails to make the string short enough, the next is tried, and so on.
$< Remove characters on the left of this marker to shorten the string.
$> Remove characters on the right of this marker to shorten the string. Only the first $< or $> within an alternative shortening is used.
Synopsis:
integer ioncore.exec(string cmd)
Description:
Run cmd with the environment variable DISPLAY set to point to the X display the WM is running on. No specific screen is set unlike with WRootWin.exec_on. The PID of the (shell executing the) new process is returned.
Synopsis:
WScreen ioncore.find_screen_id(integer id)
Description:
Find the screen with numerical id id. If Xinerama is not present, id corresponds to X screen numbers. Otherwise the ids are some arbitrary ordering of Xinerama rootwins. If id is −1, the screen with the highest id is returned.
Synopsis:
table ioncore.get()
Description:
Get ioncore basic settings. For details see ioncore.set.
Synopsis:
table ioncore.get_paths(table tab)
Description:
Get important directories (userdir, sessiondir, searchpath).
Synopsis:
WScreen ioncore.goto_next_screen()
Description:
Switch focus to the next screen and return it.

Note that this function is asynchronous; the screen will not actually have received the focus when this function returns.
Synopsis:
WScreen ioncore.goto_nth_screen(integer id)
Description:
Switch focus to the screen with id id and return it.

Note that this function is asynchronous; the screen will not actually have received the focus when this function returns.
Synopsis:
WScreen ioncore.goto_prev_screen()
Description:
Switch focus to the previous screen and return it.

Note that this function is asynchronous; the screen will not actually have received the focus when this function returns.
Synopsis:
WRegion ioncore.goto_previous()
Description:
Go to and return to a previously active region (if any).

Note that this function is asynchronous; the region will not actually have received the focus when this function returns.
Synopsis:
bool ioncore.is_i18n()
Description:
Is Ion supporting locale-specifically multibyte-encoded strings?
Synopsis:
bool ioncore.load_module(string modname)
Description:
Attempt to load a C-side module.
Synopsis:
WClientWin ioncore.lookup_clientwin(string name)
Description:
Attempt to find a client window with name name.
Synopsis:
WRegion ioncore.lookup_region(string name, string typenam)
Description:
Attempt to find a non-client window region with name name and type inheriting typenam.
Synopsis:
integer ioncore.popen_bgread(string cmd, function h, function errh)
Description:
Run cmd with a read pipe connected to its stdout. When data is received through the pipe, handler is called with that data.
Synopsis:
string ioncore.progname()
Description:
Returns the name of program using Ioncore.
Synopsis:
table ioncore.region_list(string typenam)
Description:
Find all non-client window regions inheriting typenam.
Synopsis:
void ioncore.request_selection(function fn)
Description:
Request (string) selection. The function fn will be called with the selection when and if it is received.
Synopsis:
void ioncore.resign()
Description:
Causes the window manager to simply exit without saving state/session.
Synopsis:
void ioncore.restart()
Description:
Restart, saving session first.
Synopsis:
void ioncore.restart_other(string cmd)
Description:
Attempt to restart another window manager cmd.
Synopsis:
void ioncore.set(table tab)
Description:
Set ioncore basic settings. The table tab may contain the following fields.
Field Description
opaque_resize (boolean) Controls whether interactive move and resize operations simply draw a rubberband during the operation (false) or immediately affect the object in question at every step (true).
warp (boolean) Should focusing operations move the pointer to the object to be focused?
switchto (boolean) Should a managing WMPlex switch to a newly mapped client window?
screen_notify (boolean) Should notification tooltips be displayed for hidden workspaces with activity?
frame_add_last (boolean) Add new regions in frames last instead of after current region.
dblclick_delay (integer) Delay between clicks of a double click.
default_ws_type (string) Default workspace type for operations that create a workspace.
kbresize_delay (integer) Delay in milliseconds for ending keyboard resize mode after inactivity.
kbresize_t_max (integer) Controls keyboard resize acceleration. See description below for details.
kbresize_t_min (integer) See below.
kbresize_step (floating point) See below.
kbresize_maxacc (floating point) See below.
framed_transients (boolean) Put transients in nested frames.

When a keyboard resize function is called, and at most kbresize_t_max milliseconds has passed from a previous call, acceleration factor is reset to 1.0. Otherwise, if at least kbresize_t_min milliseconds have passed from the from previous acceleration update or reset the squere root of the acceleration factor is incremented by kbresize_step. The maximum acceleration factor (pixels/call modulo size hints) is given by kbresize_maxacc. The default values are (200, 50, 30, 100).
Synopsis:
void ioncore.set_get_winprop_fn(function fn)
Description:
Set function used to look up winprops.
Synopsis:
bool ioncore.set_paths(table tab)
Description:
Set important directories (sessiondir, searchpath).
Synopsis:
void ioncore.set_selection(string p)
Description:
Set primary selection and cutbuffer0 to p.
Synopsis:
void ioncore.shutdown()
Description:
End session saving it first.
Synopsis:
void ioncore.snapshot()
Description:
Save session.
Synopsis:
table ioncore.tagged_list()
Description:
Returns a list of tagged regions.
Synopsis:
string ioncore.version()
Description:
Returns Ioncore version string.
Synopsis:
void ioncore.warn(string str)
Description:
Issue a warning. How the message is displayed depends on the current warning handler.
Synopsis:
void ioncore.x_change_property(integer win, integer atom, integer atom_type, integer format, string mode, table tab)
Description:
Modify a window property. The mode is one of "replace", "prepend" or "append", and format is either 8, 16 or 32. Also see ioncore.x_get_window_property and the XChangeProperty(3) manual page.
Synopsis:
void ioncore.x_delete_property(integer win, integer atom)
Description:
Delete a window property.
Synopsis:
string ioncore.x_get_atom_name(integer atom)
Description:
Get the name of an atom. See XGetAtomName(3) manual page for details.
Synopsis:
table ioncore.x_get_text_property(integer win, integer atom)
Description:
Get a text property for a window (STRING, COMPOUND_TEXT, or UTF8_STRING property converted). The fields in the returned table (starting from 1) are the null-separated parts of the property. See the XGetTextProperty(3) manual page for more information.
Synopsis:
table ioncore.x_get_window_property(integer win, integer atom, integer atom_type, integer n32expected, bool more)
Description:
Get a property atom of type atom_type for window win. The n32expected parameter indicates the expected number of 32bit words, and more indicates whether all or just this amount of data should be fetched. Each 8, 16 or 32bit element of the property, as deciphered from atom_type is a field in the returned table. See XGetWindowProperty(3) manual page for more information.
Synopsis:
integer ioncore.x_intern_atom(string name, bool only_if_exists)
Description:
Create a new atom. See XInternAtom(3) manual page for details.
Synopsis:
void ioncore.x_set_text_property(integer win, integer atom, table tab)
Description:
Set a text property for a window. The fields of tab starting from 1 should be the different null-separated parts of the property. See the XSetTextProperty(3) manual page for more information.
Synopsis:
ioncore.kpress(keyspec, cmd, guard)
Description:
Creates a binding description table for the action of pressing a key given by keyspec (with possible modifiers) to the function func. For more information on bindings, see section 3.3.
Synopsis:
ioncore.kpress_wait(keyspec, cmd, guard)
Description:
This is similar to kpress but after calling cmd, Ioncore waits for all modifiers to be released before processing any further actions. For more information on bindings, see section 3.3.
Synopsis:
ioncore.match_winprop_name(prop, cwin)
Description:
The basic name-based winprop matching criteria.
Synopsis:
ioncore.mclick(buttonspec, cmd, guard)
Description:
Creates a binding description table for the action of clicking a mouse button while possible modifier keys are pressed, both given by buttonspec, to the function func. For more information, see section 3.3.
Synopsis:
ioncore.mdblclick(buttonspec, cmd, guard)
Description:
Similar to mclick but for double-click. Also see section 3.3.
Synopsis:
ioncore.mdrag(buttonspec, cmd, guard)
Description:
Creates a binding description table for the action of moving the mouse (or other pointing device) while the button given by buttonspec is held pressed and the modifiers given by buttonspec were pressed when the button was initially pressed. Also see section 3.3.
Synopsis:
ioncore.menuentry(name, cmd, guard)
Description:
Use this function to define normal menu entries. The string name is the string shown in the visual representation of menu, and the parameter cmd and guard are similar to those of ioncore.defbindings.
Synopsis:
ioncore.mpress(buttonspec, cmd, guard)
Description:
Similar to mclick but for just pressing the mouse button. Also see section 3.3.
Synopsis:
ioncore.refresh_stylelist()
Description:
Refresh list of known style files.
Synopsis:
ioncore.submap(kcb_, list)
Description:
Returns a function that creates a submap binding description table. When the key press action keyspec occurs, Ioncore will wait for a further key presse and act according to the submap. For details, see section 3.3.
Synopsis:
ioncore.submenu(name, sub_or_name, options)
Description:
Use this function to define menu entries for submenus. The parameter sub_or_name is either a table of menu entries or the name of an already defined menu. The initial menu entry to highlight can be specified by options.initial as either an integer starting from 1, or a function that returns such a number. Another option supported is options.noautoexpand that will cause mod_query.query_menu to not automatically expand this submenu.

6.1.1  WClientWin functions

Synopsis:
bool WClientWin.attach_transient(WClientWin cwin, WRegion reg)
Description:
Manage reg as a transient of cwin.
Synopsis:
table WClientWin.get_ident(WClientWin cwin)
Description:
Returns a table containing the properties WM_CLASS (table entries instance and class) and WM_WINDOW_ROLE (role) properties for cwin. If a property is not set, the corresponding field(s) are unset in the table.
Synopsis:
bool WClientWin.is_fullscreen(WClientWin cwin)
Description:
Is cwin in full screen mode?
Synopsis:
void WClientWin.kill(WClientWin cwin)
Description:
Attempt to kill (with XKillWindow) the client that owns the X window correspoding to cwin.
Synopsis:
table WClientWin.managed_list(WClientWin cwin)
Description:
Returns a list of regions managed by the clientwin (transients, mostly).
Synopsis:
void WClientWin.nudge(WClientWin cwin)
Description:
Attempts to fix window size problems with non-ICCCM compliant programs.
Synopsis:
void WClientWin.quote_next(WClientWin cwin)
Description:
Send next key press directly to cwin.
Synopsis:
bool WClientWin.set_fullscreen(WClientWin cwin, string how)
Description:
Set client window cwin full screen state according to the parameter how (set/unset/toggle). Resulting state is returned, which may not be what was requested.
Synopsis:
void WClientWin.toggle_transients_pos(WClientWin cwin)
Description:
Toggle transients managed by cwin between top/bottom of the window.
Synopsis:
double WClientWin.xid(WClientWin cwin)
Description:
Return the X window id for the client window.

6.1.2  WFrame functions

Synopsis:
bool WFrame.is_shaded(WFrame frame)
Description:
Is frame shaded?
Synopsis:
bool WFrame.is_tabbar(WFrame frame)
Description:
Is frame's tab-bar visible?
Synopsis:
void WFrame.maximize_horiz(WFrame frame)
Description:
Attempt to toggle horizontal maximisation of frame.
Synopsis:
void WFrame.maximize_vert(WFrame frame)
Description:
Attempt to toggle vertical maximisation of frame.
Synopsis:
void WFrame.p_switch_tab(WFrame frame)
Description:
Display the region corresponding to the tab that the user pressed on. This function should only be used by binding it to a mouse action.
Synopsis:
void WFrame.p_tabdrag(WFrame frame)
Description:
Start dragging the tab that the user pressed on with the pointing device. This function should only be used by binding it to mpress or mdrag action with area ”tab”.
Synopsis:
bool WFrame.set_shaded(WFrame frame, string how)
Description:
Set shading state according to the parameter how (set/unset/toggle). Resulting state is returned, which may not be what was requested.
Synopsis:
bool WFrame.set_tabbar(WFrame frame, string how)
Description:
Set tab-bar visibility according to the parameter how (set/unset/toggle). Resulting state is returned, which may not be what was requested.

6.1.3  WInfoWin functions

Synopsis:
void WInfoWin.set_text(WInfoWin p, string str)
Description:
Set contents of the info window.

6.1.4  WMPlex functions

Synopsis:
WRegion WMPlex.attach(WMPlex mplex, WRegion reg, table param)
Description:
Attach and reparent existing region reg to mplex. The table param may contain the fields index and switchto that are interpreted as for WMPlex.attach_new.
Synopsis:
WRegion WMPlex.attach_new(WMPlex mplex, table param)
Description:
Create a new region to be managed by mplex. At least the following fields in param are understood:
Field Description
type Class name (a string) of the object to be created. Mandatory.
name Name of the object to be created (a string). Optional.
switchto Should the region be switched to (boolean)? Optional.
index Index of the new region in mplex's list of managed objects (integer, 0 = first). Optional.
layer Layer to attach on; 1 (default) or 2.
passive Is a layer 2 object passive/skipped when deciding object to gives focus to (boolean)? Optional.

In addition parameters to the region to be created are passed in this same table.
Synopsis:
void WMPlex.attach_tagged(WMPlex mplex)
Description:
Attach all tagged regions to mplex.
Synopsis:
void WMPlex.dec_index(WMPlex mplex, WRegion r)
Description:
Move r ”right” within objects managed by mplex.
Synopsis:
integer WMPlex.get_index(WMPlex mplex, WRegion reg)
Description:
Get index of reg within the multiplexer. The first region managed by mplex has index zero. If reg is not managed by mplex, -1 is returned.
Synopsis:
table WMPlex.get_stdisp(WMPlex mplex)
Description:
Get status display information. See WMPlex.get_stdisp for information on the fields.
Synopsis:
void WMPlex.inc_index(WMPlex mplex, WRegion r)
Description:
Move r ”right” within objects managed by mplex.
Synopsis:
bool WMPlex.l2_is_hidden(WMPlex mplex, WRegion reg)
Description:
Is reg on the layer2 of mplex and hidden?
Synopsis:
bool WMPlex.l2_is_passive(WMPlex mplex, WRegion reg)
Description:
Is reg on the layer2 of mplex and passive?
Synopsis:
bool WMPlex.l2_set_hidden(WMPlex mplex, WRegion reg, string how)
Description:
Set the visibility of the layer2 region reg on mplex as specified with the parameter how (set/unset/toggle). The resulting state is returned.
Synopsis:
bool WMPlex.l2_set_passive(WMPlex mplex, WRegion reg, string how)
Description:
Set the passivity of the layer2 region reg on mplex as specified with the parameter how (set/unset/toggle). The resulting state is returned.
Synopsis:
integer WMPlex.layer(WMPlex mplex, WRegion reg)
Description:
Returns the layer reg is on mplex or −1 if reg is not managed by mplex.
Synopsis:
integer WMPlex.lcount(WMPlex mplex, integer l)
Description:
Returns the number of regions managed by mplex on layer l.
Synopsis:
WRegion WMPlex.lcurrent(WMPlex mplex, integer l)
Description:
Return the managed object currently active within layer l of mplex.
Synopsis:
table WMPlex.llist(WMPlex mplex, integer l)
Description:
Returns a list of regions managed by mplex on layer l.
Synopsis:
WRegion WMPlex.lnth(WMPlex mplex, integer l, integer n)
Description:
Returns the n:th object managed by mplex on the the l:th layer..
Synopsis:
void WMPlex.set_index(WMPlex mplex, WRegion reg, integer index)
Description:
Set index of reg within the multiplexer to index.
Synopsis:
WRegion WMPlex.set_stdisp(WMPlex mplex, table t)
Description:
Set/create status display for mplex. Table is a standard description of the object to be created (as passed to e.g. WMPlex.attach_new). In addition, the following fields are recognised:
Field Description
pos The corner of the screen to place the status display in. One of tl, tr, bl or br.
action If this field is set to keep, corner and orientation are changed for the existing status display. If this field is set to remove, the existing status display is removed. If this field is not set or is set to replace, a new status display is created and the old, if any, removed.
Synopsis:
void WMPlex.switch_next(WMPlex mplex)
Description:
Have mplex display next (wrt. currently selected) object managed by it.
Synopsis:
void WMPlex.switch_nth(WMPlex mplex, integer n)
Description:
Have mplex display the n:th object managed by it.
Synopsis:
void WMPlex.switch_prev(WMPlex mplex)
Description:
Have mplex display previous (wrt. currently selected) object managed by it.

6.1.5  WMoveresMode functions

Synopsis:
void WMoveresMode.cancel(WMoveresMode mode)
Description:
Return from move/resize cancelling changes if opaque move/resize has not been enabled.
Synopsis:
void WMoveresMode.finish(WMoveresMode mode)
Description:
Return from move/resize mode and apply changes unless opaque move/resize is enabled.
Synopsis:
void WMoveresMode.move(WMoveresMode mode, integer horizmul, integer vertmul)
Description:
Move resize mode target one step:
horizmul/vertmul effect
-1 Move left/up
0 No effect
1 Move right/down
Synopsis:
void WMoveresMode.resize(WMoveresMode mode, integer left, integer right, integer top, integer bottom)
Description:
Shrink or grow resize mode target one step in each direction. Acceptable values for the parameters left, right, top and bottom are as follows: -1: shrink along, 0: do not change, 1: grow along corresponding border.

6.1.6  WRegion functions

Synopsis:
WMoveresMode WRegion.begin_kbresize(WRegion reg)
Description:
Enter move/resize mode for reg. The bindings set with ioncore.set_bindings for WMoveresMode are used in this mode. Of the functions exported by the Ion C core, only WMoveresMode.resize, WMoveresMode.move, WMoveresMode.cancel and WMoveresMode.end are allowed to be called while in this mode.
Synopsis:
WRegion WRegion.current(WRegion mgr)
Description:
Return the object, if any, that is considered ”currently active” within the objects managed by mplex.
Synopsis:
table WRegion.geom(WRegion reg)
Description:
Returns the geometry of reg within its parent; a table with fields x, y, w and h.
Synopsis:
bool WRegion.goto(WRegion reg)
Description:
Attempt to display reg, save region activity status and then warp to (or simply set focus to if warping is disabled) reg.

Note that this function is asynchronous; the region will not actually have received the focus when this function returns.
Synopsis:
bool WRegion.is_active(WRegion reg)
Description:
Is reg active/does it or one of it's children of focus?
Synopsis:
bool WRegion.is_activity(WRegion reg)
Description:
Is activity notification set on reg.
Synopsis:
bool WRegion.is_mapped(WRegion reg)
Description:
Is reg visible/is it and all it's ancestors mapped?
Synopsis:
bool WRegion.is_tagged(WRegion reg)
Description:
Is reg tagged?
Synopsis:
WRegion WRegion.manager(WRegion reg)
Description:
Returns the region that manages reg.
Synopsis:
string WRegion.name(WRegion reg)
Description:
Returns the name for reg.
Synopsis:
WWindow WRegion.parent(WRegion reg)
Description:
Returns the parent region of reg.
Synopsis:
WRootWin WRegion.rootwin_of(WRegion reg)
Description:
Returns the root window reg is on.
Synopsis:
bool WRegion.rqclose(WRegion reg, bool relocate)
Description:
Attempt to close/destroy reg. Whether this operation works depends on whether the particular type of region in question has implemented the feature and, in case of client windows, whether the client supports the WM_DELETE protocol (see also WClientWin.kill). If the operation is likely to succeed, true is returned, otherwise false. In most cases the region will not have been actually destroyed when this function returns. If relocate is not set, and reg manages other regions, it will not be closed. Otherwise the managed regions will be attempted to be relocated.
Synopsis:
WRegion WRegion.rqclose_propagate(WRegion reg, WRegion maybe_sub)
Description:
Recursively attempt to close a region or one of the regions managed by it. If sub is set, it will be used as the managed region, otherwise WRegion.current(reg). The object to be closed is returned or NULL if nothing can be closed. Also see notes for WRegion.rqclose.
Synopsis:
table WRegion.rqgeom(WRegion reg, table g)
Description:
Attempt to resize and/or move reg. The table g is a usual geometry specification (fields x, y, w and h), but may contain missing fields, in which case, reg's manager may attempt to leave that attribute unchanged.
Synopsis:
WScreen WRegion.screen_of(WRegion reg)
Description:
Returns the screen reg is on.
Synopsis:
bool WRegion.set_activity(WRegion reg, string how)
Description:
Set activity flag of reg. The how parameter most be one of (set/unset/toggle).
Synopsis:
bool WRegion.set_name(WRegion reg, string p)
Description:
Set the name of reg to p. If the name is already in use, an instance number suffix <n> will be attempted. If p has such a suffix, it will be modified, otherwise such a suffix will be added. Setting p to nil will cause current name to be removed.
Synopsis:
bool WRegion.set_name_exact(WRegion reg, string p)
Description:
Similar to WRegion.set_name except if the name is already in use, other instance numbers will not be attempted. The string p should not contain a <n> suffix or this function will fail.
Synopsis:
bool WRegion.set_tagged(WRegion reg, string how)
Description:
Change tagging state of reg as defined by how (set/unset/toggle). Resulting state is returned.
Synopsis:
table WRegion.size_hints(WRegion reg)
Description:
Returns size hints for reg. The returned table always contains the fields min_?, base_? and sometimes the fields max_?, base_? and inc_?, where ?=w, h.

6.1.7  WRootWin functions

Synopsis:
WScreen WRootWin.current_scr(WRootWin rootwin)
Description:
Returns previously active screen on root window rootwin.

6.1.8  WScreen functions

Synopsis:
integer WScreen.id(WScreen scr)
Description:
Return the numerical id for screen scr.
Synopsis:
bool WScreen.set_managed_offset(WScreen scr, table offset)
Description:
Set offset of objects managed by the screen from actual screen geometry. The table offset should contain the entries x, y, w and h indicating offsets of that component of screen geometry.

6.1.9  WWindow functions

Synopsis:
void WWindow.p_move(WWindow wwin)
Description:
Start moving wwin with the mouse or other pointing device. This function should only be used by binding it to mpress or mdrag action.
Synopsis:
void WWindow.p_resize(WWindow wwin)
Description:
Start resizing wwin with the mouse or other pointing device. This function should only be used by binding it to mpress or mdrag action.
Synopsis:
double WWindow.xid(WWindow wwin)
Description:
Return the X window id for wwin.

6.1.10  global functions

Synopsis:
export(lib, ...)
Description:
Export a list of functions from lib into global namespace.

6.1.11  gr functions

Synopsis:
void gr.read_config()
Description:
Read drawing engine configuration file draw.lua.
Synopsis:
void gr.refresh()
Description:
Refresh objects' brushes to update them to use newly loaded style.
Synopsis:
bool gr.select_engine(string engine)
Description:
Future requests for ”brushes” are to be forwarded to the drawing engine engine. If no engine of such name is known, a module with that name is attempted to be loaded. This function is only intended to be called from colour scheme etc. configuration files and can not be used to change the look of existing objects; for that use gr.read_config.

6.1.12  string functions

Synopsis:
string.shell_safe(str)
Description:
Make str shell-safe.

6.1.13  table functions

Synopsis:
table.copy(t, deep)
Description:
Make copy of table. If deep is unset, shallow one-level copy is made, otherwise a deep copy is made.
Synopsis:
table.icat(t1, t2)
Description:
Insert all positive integer entries from t2 into t1.
Synopsis:
table.join(t1, t2)
Description:
Create a table containing all entries from t1 and those from t2 that are missing from t1.
Synopsis:
table.map(f, t)
Description:
Map all entries of t by f.

6.2  Functions defined in mod_ionws

Synopsis:
table mod_ionws.get()
Description:
Get parameters. For details see mod_ionws.set.
Synopsis:
void mod_ionws.set(table tab)
Description:
Set parameters. Currently only raise_delay (in milliseconds) is supported.

6.2.1  WIonWS functions

Synopsis:
WRegion WIonWS.farthest(WIonWS ws, string dirstr, bool any)
Description:
Return the most previously active region on ws with no other regions next to it in direction dirstr (left/right/up/down). If any is not set, the status display is not considered.
Synopsis:
WRegion WIonWS.goto_dir(WIonWS ws, string dirstr)
Description:
Go to the most previously active region on ws next to reg in direction dirstr (up/down/left/right), wrapping around to a most recently active farthest region in the opposite direction if reg is already the further region in the given direction.

Note that this function is asynchronous; the region will not actually have received the focus when this function returns.
Synopsis:
WRegion WIonWS.goto_dir_nowrap(WIonWS ws, string dirstr)
Description:
Go to the most previously active region on ws next to reg in direction dirstr (up/down/left/right) without wrapping around.
Synopsis:
table WIonWS.managed_list(WIonWS ws)
Description:
Returns a list of regions managed by the workspace (frames, mostly).
Synopsis:
WRegion WIonWS.nextto(WIonWS ws, WRegion reg, string dirstr, bool any)
Description:
Return the most previously active region next to reg in direction dirstr (left/right/up/down). The region reg must be managed by ws. If any is not set, the status display is not considered.
Synopsis:
WSplitRegion WIonWS.node_of(WIonWS ws, WRegion reg)
Description:
For region reg managed by ws return the WSplit a leaf of which reg is.
Synopsis:
bool WIonWS.set_floating_at(WIonWS ws, WRegion reg, string how, string dirstr)
Description:
Toggle floating of the sides of a split containin reg as indicated by the parameters how (set/unset/toggle) and dirstr (left/right/up/down/any). The new status is returned (and false also on error).
Synopsis:
WSplitSplit WIonWS.set_floating(WIonWS ws, WSplitSplit split, string how)
Description:
Toggle floating of a split's sides at split as indicated by the parameter how (set/unset/toggle). A split of the appropriate is returned, if there was a change.
Synopsis:
WFrame WIonWS.split(WIonWS ws, WSplit node, string dirstr)
Description:
Create a new frame on ws above/below/left of/right of node as indicated by dirstr. If dirstr is prefixed with ”floating:” a floating split is created.
Synopsis:
WFrame WIonWS.split_at(WIonWS ws, WFrame frame, string dirstr, bool attach_current)
Description:
Split frame creating a new frame to direction dirstr (one of ”left”, ”right”, ”top” or ”bottom”) of frame. If attach_current is set, the region currently displayed in frame, if any, is moved to thenew frame. If dirstr is prefixed with ”floating:” a floating split is created.
Synopsis:
WFrame WIonWS.split_top(WIonWS ws, string dirstr)
Description:
Same as WIonWS.split at the root of the split tree.
Synopsis:
WSplit WIonWS.split_tree(WIonWS ws)
Description:
Returns the root of the split tree.
Synopsis:
bool WIonWS.unsplit_at(WIonWS ws, WFrame frame)
Description:
Try to relocate regions managed by frame to another frame and, if possible, destroy the frame.
Synopsis:
bool WIonWS.flip_at(WIonWS ws, WRegion reg)
Description:
Flip ws at reg or root if nil.
Synopsis:
bool WIonWS.transpose_at(WIonWS ws, WRegion reg)
Description:
Transpose ws at reg or root if nil.

6.2.2  WSplit functions

Synopsis:
table WSplit.geom(WSplit split)
Description:
Returns the area of workspace used by the regions under split.
Synopsis:
WSplitInner WSplit.parent(WSplit split)
Description:
Return parent split for split.
Synopsis:
table WSplit.rqgeom(WSplit node, table g)
Description:
Attempt to resize and/or move the split tree starting at node. Behaviour and the g parameter are as for WRegion.rqgeom operating on node (if it were a WRegion).
Synopsis:
void WSplit.transpose(WSplit node)
Description:
Transpose contents of node.

6.2.3  WSplitInner functions

Synopsis:
WSplit WSplitInner.current(WSplitInner node)
Description:
Returns the most previously active child node of split.

6.2.4  WSplitRegion functions

Synopsis:
WRegion WSplitRegion.reg(WSplitRegion node)
Description:
Returns the region contained in node.

6.2.5  WSplitSplit functions

Synopsis:
WSplit WSplitSplit.br(WSplitSplit split)
Description:
Returns the bottom or right child node of split depending on the direction of the split.
Synopsis:
string WSplitSplit.dir(WSplitSplit split)
Description:
Returns the direction of split; either ”vertical” or ”horizontal”.
Synopsis:
void WSplitSplit.flip(WSplitSplit split)
Description:
Flip contents of node.
Synopsis:
WSplit WSplitSplit.tl(WSplitSplit split)
Description:
Returns the top or left child node of split depending on the direction of the split.

6.3  Functions defined in mod_floatws

Synopsis:
table mod_floatws.get()
Description:
Get module basic settings. See mod_floatws.set for more information.
Synopsis:
void mod_floatws.set(table tab)
Description:
Set module basic settings. Currently only the placement_method parameter is supported.

The method can be one of ”udlr”, ”lrud” (default) and ”random”. The ”udlr” method looks for free space starting from top the top left corner of the workspace moving first down keeping the x coordinate fixed. If it find no free space, it start looking similarly at next x coordinate unoccupied by other objects and so on. ”lrud' is the same but with the role of coordinates changed and both fall back to ”random” placement if no free area was found.

6.3.1  WFloatFrame functions

Synopsis:
bool WFloatFrame.is_sticky(WFloatFrame frame)
Description:
Is frame sticky?
Synopsis:
bool WFloatFrame.set_sticky(WFloatFrame frame, string how)
Description:
Set frame stickyness accoding to how (set/unset/toggle). The resulting state is returned. This function only works across frames on WFloatWS that have the same WMPlex parent.

6.3.2  WFloatWS functions

Synopsis:
bool WFloatWS.attach(WFloatWS ws, WClientWin cwin, table t)
Description:
Attach client window cwin on ws. At least the following fields in t are supported:
Field Description
switchto Should the region be switched to (boolean)? Optional.
geom Geometry; x and y, if set, indicates top-left of the frame to be created while width and height, if set, indicate the size of the client window within that frame. Optional.
Synopsis:
WRegion WFloatWS.backcirculate(WFloatWS ws)
Description:
Activate previous object in stacking order on ws.
Synopsis:
WRegion WFloatWS.circulate(WFloatWS ws)
Description:
Activate next object in stacking order on ws.
Synopsis:
void WFloatWS.lower(WFloatWS ws, WRegion reg)
Description:
Lower reg that must be managed by ws. If reg is nil, this function silently fails.
Synopsis:
table WFloatWS.managed_list(WFloatWS ws)
Description:
Returns a list of regions managed by the workspace (frames, mostly).
Synopsis:
void WFloatWS.raise(WFloatWS ws, WRegion reg)
Description:
Raise reg that must be managed by ws. If reg is nil, this function silently fails.

6.4  Functions defined in mod_panews

Synopsis:
mod_panews.get()
Description:
Get some module settings. See mod_panews.set for documentation on the contents of the returned table.
Synopsis:
mod_panews.set(s)
Description:
Set some module parameters. Currently s may contain the following fields:
Field Description
template layout template for newly created WPaneWS workspaces. This can be either a table or one of the predefined layouts 'default', 'alternative1', and 'alternative2'.
scalef Scale factor for classification heuristics to work with different screen resolutions. The default is 1.0 and is designed for 1280x1024 at 75dpi.
valid_classifications A table with valid window classifications as valid keys.

6.4.1  WSplitPane functions

Synopsis:
WSplit WSplitPane.contents(WSplitPane pane)
Description:
Get root of contained sub-split tree.
Synopsis:
string WSplitPane.marker(WSplitPane pane)
Description:
Get marker.
Synopsis:
bool WSplitPane.set_marker(WSplitPane pane, string s)
Description:
Set marker.

6.5  Functions defined in mod_query

Synopsis:
mod_query.defcmd(cmd, fn)
Description:
Define a command override for the mod_query query.
Synopsis:
table mod_query.get()
Description:
Get module configuration. For more information see mod_query.set.
Synopsis:
void mod_query.history_clear()
Description:
Clear line editor history.
Synopsis:
string mod_query.history_get(integer n)
Description:
Get entry at index n in line editor history, 0 being the latest.
Synopsis:
bool mod_query.history_push(string str)
Description:
Push an entry into line editor history.
Synopsis:
integer mod_query.history_search(string s, integer from, bool bwd)
Description:
Try to find matching history entry.
Synopsis:
table mod_query.history_table()
Description:
Return table of history entries.
Synopsis:
WMessage mod_query.message(WMPlex mplex, string p)
Description:
Display a message in the mplex.
Synopsis:
void mod_query.set(table tab)
Description:
Set module configuration. The following are supported:
Field Description
autoshowcompl (boolean) Is auto-show-completions enabled? (default: true).
autoshowcompl_delay (integer) auto-show-completions delay in milliseconds (default: 250).
Synopsis:
WMessage mod_query.warn(WMPlex mplex, string p)
Description:
Display an error message box in the multiplexer mplex.
Synopsis:
mod_query.popen_completions(cp, cmd, beg, fn)
Description:
This function can be used to read completions from an external source. The string cmd is a shell command to be executed. To its stdout, the command should on the first line write the common_beg parameter of WComplProxy.set_completions and a single actual completion on each of the successive lines.
Synopsis:
mod_query.query(mplex, prompt, initvalue, handler, completor, context)
Description:
Low-level query routine. mplex is the WMPlex to display the query in, prompt the prompt string, and initvalue the initial contents of the query box. handler is a function that receives (mplex, result string) as parameter when the query has been succesfully completed, completor the completor routine which receives a (cp, str, point) as parameters. The parameter str is the string to be completed and point cursor's location within it. Completions should be eventually, possibly asynchronously, set with WComplProxy.set_completions on cp.
Synopsis:
mod_query.query_attachclient(mplex)
Description:
This query asks for the name of a client window and switches focus to the one entered. It uses the completion function ioncore.complete_clientwin.
Synopsis:
mod_query.query_editfile(mplex, script, prompt)
Description:
Asks for a file to be edited. This script uses run-mailcap –mode=edit by default, but you may provide an alternative script to use. The default prompt is "Edit file:" (translated).
Synopsis:
mod_query.query_exec(mplex)
Description:
This function asks for a command to execute with /bin/sh. If the command is prefixed with a colon (':'), the command will be run in an XTerm (or other terminal emulator) using the script ion-runinxterm. Two colons ('::') will ask you to press enter after the command has finished.
Synopsis:
mod_query.query_gotoclient(mplex)
Description:
This query asks for the name of a client window and attaches it to the frame the query was opened in. It uses the completion function ioncore.complete_clientwin.
Synopsis:
mod_query.query_lua(mplex)
Description:
This query asks for Lua code to execute. It sets the variable '_' in the local environment of the string to point to the mplex where the query was created. It also sets the table arg in the local environment to {_, _:current()}.
Synopsis:
mod_query.query_man(mplex, prog)
Description:
This query asks for a manual page to display. By default it runs the man command in an xterm using ion-runinxterm, but it is possible to pass another program as the prog argument.
Synopsis:
mod_query.query_menu(mplex, themenu, prompt)
Description:
This query can be used to create a query of a defined menu.
Synopsis:
mod_query.query_renameframe(frame)
Description:
This function asks for a name new for the frame where the query was created.
Synopsis:
mod_query.query_renameworkspace(mplex)
Description:
This function asks for a name new for the workspace on which the query resides.
Synopsis:
mod_query.query_restart(mplex)
Description:
This query asks whether the user wants restart Ioncore. If the answer is 'y', 'Y' or 'yes', so will happen.
Synopsis:
mod_query.query_runfile(mplex, script, prompt)
Description:
Asks for a file to be viewed. This script uses run-mailcap –action=view by default, but you may provide an alternative script to use. The default prompt is "View file:" (translated).
Synopsis:
mod_query.query_shutdown(mplex)
Description:
This query asks whether the user wants to exit Ion (no session manager) or close the session (running under a session manager that supports such requests). If the answer is 'y', 'Y' or 'yes', so will happen.
Synopsis:
mod_query.query_ssh(mplex, ssh)
Description:
This query asks for a host to connect to with SSH. Hosts to tab-complete are read from ~/.ssh/known_hosts.
Synopsis:
mod_query.query_workspace(mplex)
Description:
This query asks for the name of a workspace. If a workspace (an object inheriting WGenWS) with such a name exists, it will be switched to. Otherwise a new workspace with the entered name will be created and the user will be queried for the type of the workspace.
Synopsis:
mod_query.query_yesno(mplex, prompt, handler)
Description:
This function query will display a query with prompt prompt in mplex and if the user answers affirmately, call handler with mplex as parameter.
Synopsis:
mod_query.show_about_ion(mplex)
Description:
Display an "About Ion" message in mplex.
Synopsis:
mod_query.show_clientwin(mplex, cwin)
Description:
Show information about a client window.

6.5.1  WComplProxy functions

Synopsis:
bool WComplProxy.set_completions(WComplProxy proxy, table compls)
Description:
Set completion list of the WEdln that proxy refers to to compls, if it is still waiting for this completion run. The numerical indexes of compls list the found completions. If the entry common_beg (common_end) exists, it gives an extra common prefix (suffix) of all found completions.

6.5.2  WEdln functions

Synopsis:
void WEdln.back(WEdln wedln)
Description:
Move backward one character.
Synopsis:
void WEdln.backspace(WEdln wedln)
Description:
Delete previous character.
Synopsis:
void WEdln.bkill_word(WEdln wedln)
Description:
Starting from the previous characters, delete possible whitespace and preceding alphanumeric characters until previous non-alphanumeric character.
Synopsis:
void WEdln.bol(WEdln wedln)
Description:
Go to the beginning of line.
Synopsis:
void WEdln.bskip_word(WEdln wedln)
Description:
Go to to beginning of current sequence of alphanumeric characters followed by whitespace.
Synopsis:
void WEdln.clear_mark(WEdln wedln)
Description:
Clear mark.
Synopsis:
void WEdln.complete(WEdln wedln, bool cycle)
Description:
Call completion handler with the text between the beginning of line and current cursor position, or select next completion from list if in auto-show-completions mode and cycle is set.
Synopsis:
string WEdln.contents(WEdln wedln)
Description:
Get line editor contents.
Synopsis:
string WEdln.context(WEdln wedln)
Description:
Get history context for wedln.
Synopsis:
void WEdln.copy(WEdln wedln)
Description:
Copy text between mark and current cursor position to clipboard.
Synopsis:
void WEdln.cut(WEdln wedln)
Description:
Copy text between mark and current cursor position to clipboard and then delete that sequence.
Synopsis:
void WEdln.delete(WEdln wedln)
Description:
Delete current character.
Synopsis:
void WEdln.eol(WEdln wedln)
Description:
Go to the end of line.
Synopsis:
void WEdln.finish(WEdln wedln)
Description:
Close wedln and call any handlers.
Synopsis:
void WEdln.forward(WEdln wedln)
Description:
Move forward one character.
Synopsis:
void WEdln.history_next(WEdln wedln, bool match)
Description:
Replace line editor contents with next entry in history if one exists. If match is true, the initial part of the history entry must match the current line from beginning to point.
Synopsis:
void WEdln.history_prev(WEdln wedln, bool match)
Description:
Replace line editor contents with previous in history if one exists. If match is true, the initial part of the history entry must match the current line from beginning to point.
Synopsis:
void WEdln.insstr(WEdln wedln, string str)
Description:
Input str in wedln at current editing point.
Synopsis:
void WEdln.kill_line(WEdln wedln)
Description:
Delete the whole line.
Synopsis:
void WEdln.kill_to_bol(WEdln wedln)
Description:
Delete all characters from previous to beginning of line.
Synopsis:
void WEdln.kill_to_eol(WEdln wedln)
Description:
Delete all characters from current to end of line.
Synopsis:
void WEdln.kill_word(WEdln wedln)
Description:
Starting from the current point, delete possible whitespace and following alphanumeric characters until next non-alphanumeric character.
Synopsis:
integer WEdln.mark(WEdln wedln)
Description:
Get current mark (start of selection) for wedln. Return value of -1 indicates that there is no mark, and 0 is the beginning of the line.
Synopsis:
bool WEdln.next_completion(WEdln wedln)
Description:
Select next completion.
Synopsis:
void WEdln.paste(WEdln wedln)
Description:
Request selection from application holding such.

Note that this function is asynchronous; the selection will not actually be inserted before Ion receives it. This will be no earlier than Ion return to its main loop.
Synopsis:
integer WEdln.point(WEdln wedln)
Description:
Get current editing point. Beginning of the edited line is point 0.
Synopsis:
bool WEdln.prev_completion(WEdln wedln)
Description:
Select previous completion.
Synopsis:
void WEdln.set_context(WEdln wedln, string context)
Description:
Set history context for wedln.
Synopsis:
void WEdln.set_mark(WEdln wedln)
Description:
Set mark to current cursor position.
Synopsis:
void WEdln.skip_word(WEdln wedln)
Description:
Go to to end of current sequence of whitespace followed by alphanumeric characters..

6.5.3  WInput functions

Synopsis:
void WInput.cancel(WInput input)
Description:
Close input not calling any possible finish handlers.
Synopsis:
void WInput.scrolldown(WInput input)
Description:
Scroll input input text contents down.
Synopsis:
void WInput.scrollup(WInput input)
Description:
Scroll input input text contents up.

6.6  Functions defined in mod_menu

Synopsis:
mod_menu.grabmenu(mplex, sub, menu_or_name, param)
Description:
This function is similar to mod_menu.menu, but input is grabbed and the key given either directly as param or as param.key is used to cycle through the menu.
Synopsis:
mod_menu.menu(mplex, sub, menu_or_name, param)
Description:
Display a menu in the lower-left corner of mplex. The variable menu_or_name is either the name of a menu defined with mod_menu.defmenu or directly a table similar to ones passesd to this function. When this function is called from a binding handler, sub should be set to the second argument of to the binding handler (_sub) so that the menu handler will get the same parameters as the binding handler. Extra options can be passed in the table param. The initial entry can be specified as the field initial as an integer starting from 1. Menus can be made to use a bigger style by setting the field big to true.
Synopsis:
table mod_menu.get()
Description:
Get module basic settings. For details, see mod_menu.set.
Synopsis:
void mod_menu.set(table tab)
Description:
Set module basic settings. The parameter table may contain the following fields:
Field Description
scroll_amount Number of pixels to scroll at a time pointer-controlled menus when one extends beyond a border of the screen and the pointer touches that border.
scroll_delay Time between such scrolling events in milliseconds.
Synopsis:
mod_menu.pmenu(win, sub, menu_or_name)
Description:
This function displays a drop-down menu and should only be called from a mouse press handler. The parameters are similar to those of mod_menu.menu.

6.6.1  WMenu functions

Synopsis:
void WMenu.cancel(WMenu menu)
Description:
Close menu not calling any possible finish handlers.
Synopsis:
void WMenu.finish(WMenu menu)
Description:
If selected entry is a submenu, display that. Otherwise destroy the menu and call handler for selected entry.
Synopsis:
void WMenu.select_next(WMenu menu)
Description:
Select next entry in menu.
Synopsis:
void WMenu.select_nth(WMenu menu, integer n)
Description:
Select n:th entry in menu.
Synopsis:
void WMenu.select_prev(WMenu menu)
Description:
Select previous entry in menu.
Synopsis:
void WMenu.typeahead_clear(WMenu menu)
Description:
Clear typeahead buffer.

6.7  Functions defined in mod_dock

Synopsis:
void mod_dock.set_floating_shown_on(WMPlex mplex, string how)
Description:
Toggle floating docks on mplex.

6.7.1  WDock functions

Synopsis:
bool WDock.attach(WDock dock, WRegion reg)
Description:
Attach reg to dock.
Synopsis:
table WDock.get(WDock dock)
Description:
Get dock's configuration table. See WDock.set for a description of the table.
Synopsis:
void WDock.resize(WDock dock)
Description:
Resizes and refreshes dock.
Synopsis:
void WDock.set(WDock dock, table conftab)
Description:
Configure dock. conftab is a table of key/value pairs:
Key Values Description
name string Name of dock
pos string in {t,m,b}×{t,c,b} Dock position. Can only be used in floating mode.
grow up/down/left/right Growth direction where new dockapps are added. Also sets orientation for dock when working as WMPlex status display (see WMPlex.set_stdisp).
is_auto bool Should dock automatically manage new dockapps?

Any parameters not explicitly set in conftab will be left unchanged.

6.8  Functions defined in mod_sp

Synopsis:
bool mod_sp.set_shown(WScratchpad sp, string how)
Description:
Toggle displayed status of sp. The parameter how is one of (set/unset/toggle).
Synopsis:
bool mod_sp.set_shown_on(WMPlex mplex, string how)
Description:
Change displayed status of some scratchpad on mplex if one is found. The parameter how is one of (set/unset/toggle).

6.9  Functions defined in de

Synopsis:
bool de.defstyle(string name, table tab)
Description:
Define a style.
Synopsis:
bool de.defstyle_rootwin(WRootWin rootwin, string name, table tab)
Description:
Define a style for the root window rootwin.
Synopsis:
void de.reset()
Description:
Clear all styles from drawing engine memory.
Synopsis:
table de.substyle(string pattern, table tab)
Description:
Define a substyle.

6.10  Hooks

Hook name:
clientwin_do_manage_alt
Parameters:
(WClientWin, table)
Description:
Called when we want to manage a new client window. The table argument contains the following fields:
Field Type Description
switchto bool Do we want to switch to the client window.
jumpto bool Do we want to jump to the client window.
userpos bool Geometry set by user.
dockapp bool Client window is a dockapp.
maprq bool Map request (and not initialisation scan).
gravity number Window gravity.
geom table Requested geometry; x, y, w, h.
tfor WClientWin Transient for window.

This hook is not called in protected mode and can be used for arbitrary placement policies (deciding in which workspace a new WClientWin should go). In this case, you can call
reg:attach(cwin)
where reg is the region where the window should go, and cwin is the first argument of the function added to the hook.
Hook name:
clientwin_mapped_hook
Parameters:
WClientWin
Description:
Called when we have started to manage a client window.
Hook name:
clientwin_unmapped_hook
Parameters:
number
Description:
Called when we no longer manage a client window. The parameter is the X ID of the window; see WClientWin.xid.
Hook name:
frame_managed_changed_hook
Parameters:
table
Description:
Called when there are changes in the objects managed by a frame or their order. The table parameter has the following fields:
Field Type Description
reg WFrame The frame in question
mode string "switchonly", "reorder", "add" or "remove"
sw bool Switch occured
sub WRegion The managed region (primarily) affected
Hook name:
ioncore_sigchld_hook
Parameters:
integer
Description:
Called when a child process has exited. The parameter is the PID of the process.
Hook name:
ioncore_deinit_hook
Parameters:
()
Description:
Called when Ion is deinitialising and about to quit.
Hook name:
ioncore_post_layout_setup_hook
Parameters:
()
Description:
Called when Ion has done all initialisation and is almost ready to enter the mainloop, except no windows are yet being managed.
Hook name:
ioncore_snapshot_hook
Parameters:
()
Description:
Called to signal scripts and modules to save their state (if any).
Hook name:
ionws_placement_alt
Parameters:
table
Description:
Called when a client window is about to be managed by a WIonWS to allow for alternative placement policies. The table has the following fields:
Field Type Description
ws WIonWS The workspace
reg WRegion The region (always a WClientWin at the moment) to be placed
mp table This table contains the same fields as the parameter of clientwin_do_manage_alt
res_frame WFrame A succesfull handler should return the target frame here.
This hook is just for placing within a given workspace after the workspace has been decided by the default workspace selection policy. It is called in protected mode. For arbitrary placement policies, clientwin_do_manage_alt should be used; it isn't called in protected mode,
Hook name:
panews_init_layout_alt
Parameters:
table
Description:
Called to initialise panews layout. The table parameter has initially a single field ws pointing to the workspace, but the succesfull handler should set the field layout to a proper layout (as those saved in the layout savefiles).
Hook name:
panews_make_placement_alt
Parameters:
table
Description:
Called to make a placement on panews. The parameter table has the following fields:
Field Type Description
ws WPaneWS The workspace
frame WFrame A frame initially allocated for the region to be placed
reg WRegion The region to be placed
specifier WRegion For drag&drop on handling empty areas

The handler should set some of these fields on success:
Field Type Description
res_node WSplit Target split
res_config WFrame New configuration for it, unless WSplitRegion
res_w integer New width for target split (optional)
res_h integer New height for target split (optional)
Hook name:
region_activated_hook
Parameters:
WRegion
Description:
Signalled when a region or one of its children has received the focus.
Hook name:
region_do_warp_alt
Parameters:
WRegion
Description:
This alt-hook exist to allow for alternative pointer warping implementations.
Hook name:
region_inactivated_hook
Parameters:
WRegion
Description:
Signalled when the focus has moved from the parameter region or one of its children to a non-child region of the parameter region.
Hook name:
screen_managed_changed_hook
Parameters:
table
Description:
Called when there are changes in the objects managed by a screen or their order. The table parameter is similar to that of frame_managed_changed_hook.

Previous Up Next