+local default_tmpl = { switchto=true }
+
+local empty = { type="WGroupWS", managed={} }
+
+local layouts={
+ empty = empty,
+ default = empty,
+}
+
+--DOC
+-- Define a new workspace layout with name \var{name}, and
+-- attach/creation parameters given in \var{tab}. The layout
+-- "empty" may not be defined.
+function ioncore.deflayout(name, tab)
+ assert(layout ~= "empty")
+
+ if name=="default" and not tab then
+ layouts[name] = empty
+ else
+ layouts[name] = table.join(tab, group_tmpl)
+ end
+end
+
+--DOC
+-- Get named layout (or all of the latter parameter is set,
+-- but this is for internal use only).
+function ioncore.getlayout(name, all)
+ if all then
+ return layouts
+ else
+ return layouts[name]
+ end
+end
+
+ioncore.set{_get_layout=ioncore.getlayout}