2 -- ion/share/ioncore_misc.lua
4 -- Copyright (c) Tuomo Valkonen 2004-2006.
6 -- Ion is free software; you can redistribute it and/or modify it under
7 -- the terms of the GNU Lesser General Public License as published by
8 -- the Free Software Foundation; either version 2.1 of the License, or
9 -- (at your option) any later version.
13 local group_tmpl={type="WGroupWS", switchto=true}
16 -- Create new workspace on screen \var{scr}. The table \var{tmpl}
17 -- may be used to override parts of \code{default_ws_params},
18 -- and \var{no_default} may be set to \code{true} to complete ignore it.
19 function ioncore.create_ws(scr, tmpl, no_default)
20 local dflt=(not no_default and ioncore.get().default_ws_params) or {}
21 local t=table.join(table.join(tmpl or {}, dflt), group_tmpl)
23 return scr:attach_new(t)
28 -- Find an object with type name \var{t} managing \var{obj} or one of
30 function ioncore.find_manager(obj, t)
32 if obj_is(obj, t) then
41 -- gettext+string.format
42 function ioncore.TR(s, ...)
43 return string.format(ioncore.gettext(s), unpack(arg))
48 -- Run \var{cmd} with the environment variable DISPLAY set to point to the
49 -- root window of the X screen \var{reg} is on.
50 function ioncore.exec_on(reg, cmd)
51 return ioncore.do_exec_rw(reg:rootwin_of(), cmd)