]> git.decadent.org.uk Git - ion3.git/blob - etc/cfg_tiling.lua
[svn-inject] Installing original source of ion3
[ion3.git] / etc / cfg_tiling.lua
1 --
2 -- Ion tiling module configuration file
3 --
4
5 -- Bindings for the tilings. 
6
7 defbindings("WTiling", {
8     bdoc("Split current frame vertically."),
9     kpress(META.."S", "WTiling.split_at(_, _sub, 'bottom', true)"),
10     
11     bdoc("Go to frame above/below/right/left of current frame."),
12     kpress(META.."P", "ioncore.goto_next(_sub, 'up', {no_ascend=_})"),
13     kpress(META.."N", "ioncore.goto_next(_sub, 'down', {no_ascend=_})"),
14     kpress(META.."Tab", "ioncore.goto_next(_sub, 'right')"),
15     submap(META.."K", {
16         kpress("Tab", "ioncore.goto_next(_sub, 'left')"),
17         
18         bdoc("Split current frame horizontally."),
19         kpress("S", "WTiling.split_at(_, _sub, 'right', true)"),
20         
21         bdoc("Destroy current frame."),
22         kpress("X", "WTiling.unsplit_at(_, _sub)"),
23     }),
24 })
25
26
27 -- Frame bindings
28
29 defbindings("WFrame.tiled", {
30     submap(META.."K", {
31         bdoc("Detach window from tiled frame"),
32         kpress("D", "mod_tiling.detach(_sub)", "_sub:non-nil"),
33     }),
34 })
35
36
37 defbindings("WFrame.transient", {
38     submap(META.."K", {
39         bdoc("Detach transient frame"),
40         kpress("D", "mod_tiling.detach(_)", "_sub:non-nil"),
41     }),
42 })
43
44
45 defbindings("WFrame.floating", {
46     submap(META.."K", {
47         bdoc("Tile frame, if no tiling exists on the workspace"),
48         kpress("B", "mod_tiling.mkbottom(_)"),
49     }),
50 })
51
52
53 -- Context menu for tiled workspaces.
54
55 defctxmenu("WTiling", "Tiling", {
56     menuentry("Destroy frame", 
57               "WTiling.unsplit_at(_, _sub)"),
58
59     menuentry("Split vertically", 
60               "WTiling.split_at(_, _sub, 'bottom', true)"),
61     menuentry("Split horizontally", 
62               "WTiling.split_at(_, _sub, 'right', true)"),
63     
64     menuentry("Flip", "WTiling.flip_at(_, _sub)"),
65     menuentry("Transpose", "WTiling.transpose_at(_, _sub)"),
66     
67     submenu("Float split", {
68         menuentry("At left", 
69                   "WTiling.set_floating_at(_, _sub, 'toggle', 'left')"),
70         menuentry("At right", 
71                   "WTiling.set_floating_at(_, _sub, 'toggle', 'right')"),
72         menuentry("Above",
73                   "WTiling.set_floating_at(_, _sub, 'toggle', 'up')"),
74         menuentry("Below",
75                   "WTiling.set_floating_at(_, _sub, 'toggle', 'down')"),
76     }),
77
78     submenu("At root", {
79         menuentry("Split vertically", 
80                   "WTiling.split_top(_, 'bottom')"),
81         menuentry("Split horizontally", 
82                   "WTiling.split_top(_, 'right')"),
83         menuentry("Flip", "WTiling.flip_at(_)"),
84         menuentry("Transpose", "WTiling.transpose_at(_)"),
85     }),
86 })
87
88
89 -- Context menu entries for tiled frames.
90
91 defctxmenu("WFrame.tiled", "Tiled frame", {
92     menuentry("Detach window", "mod_tiling.detach(_sub)", "_sub:non-nil"),
93 })
94
95
96 -- Context menu entries for transient frames.
97
98 defctxmenu("WFrame.transient", "Transient frame", {
99     append=true,
100     menuentry("Detach", "mod_tiling.detach(_)", "_sub:non-nil"),
101 })
102
103
104 -- Extra context menu extra entries for floatframes. 
105
106 defctxmenu("WFrame.floating", "Floating frame", {
107     append=true,
108     menuentry("New tiling", "mod_tiling.mkbottom(_)"),
109 })
110
111
112 -- Adjust default workspace layout
113
114 local a_frame = {
115     type="WSplitRegion",
116     regparams = {
117         type = "WFrame", 
118         frame_style = "frame-tiled"
119     }
120 }
121     
122 ioncore.set{
123     default_ws_params = {
124         -- Destroy workspace if the 'bottom' tiling is destroyed last
125         bottom_last_close = true,
126         -- Layout
127         managed = {
128             {
129                 type = "WTiling",
130                 bottom = true,
131                 -- The default is a single 1:1 horizontal split
132                 split_tree = {
133                     type = "WSplitSplit",
134                     dir = "horizontal",
135                     tls = 1,
136                     brs = 1,
137                     tl = a_frame,
138                     br = a_frame
139                 }
140                 -- For a single frame
141                 --split_tree = nil
142             }
143         }
144     }
145 }
146