fix pselect(2) availability detection
[notion/jeffpc.git] / etc / cfg_layouts.lua
blob41bda19bd13490766ae203f472ab8e911e346a02
1 --
2 -- Layouts for Ion
3 --
5 --
6 -- Helper routines and structures
7 --
9 -- Tiled frame template for the layouts below
10 local a_frame = {
11 type="WSplitRegion",
12 regparams = {
13 type = "WFrame",
14 frame_style = "frame-tiled"
18 -- Helper function for generating splits for layouts
19 local function mksplit(dir, tl, br, float)
20 return {
21 type = (float and "WSplitFloat" or "WSplitSplit"),
22 dir = dir,
23 tls = 1,
24 brs = 1,
25 tl = tl,
26 br = br,
28 end
30 local function mktiling(split_tree)
31 return {
32 managed = {
34 type = "WTiling",
35 bottom = true, -- Make it the bottom of the group
36 split_tree = split_tree,
40 end
43 -- The layouts
46 -- Tiling with single 1:1 horizontal split
47 local tmp=mktiling(mksplit("horizontal", a_frame, a_frame))
48 ioncore.deflayout("hsplit", tmp)
49 ioncore.deflayout("default", tmp)
51 -- Tiling with single 1:1 vertical split
52 ioncore.deflayout("vsplit",
53 mktiling(mksplit("vertical", a_frame, a_frame))
56 -- Tiling with single 1:1 floating horizontal split
57 ioncore.deflayout("hfloat",
58 mktiling(mksplit("horizontal", a_frame, a_frame, true))
61 -- Tiling with single 1:1 floating vertical split
62 ioncore.deflayout("vfloat",
63 mktiling(mksplit("vertical", a_frame, a_frame, true))
66 -- Tiling with horizontal and then vertical splits
67 ioncore.deflayout("2x2",
68 mktiling(mksplit("horizontal",
69 mksplit("vertical", a_frame, a_frame),
70 mksplit("vertical", a_frame, a_frame))
74 -- Tiling with single full screen frame
75 ioncore.deflayout("full", mktiling(a_frame))