]> git.madduck.net Git - etc/awesome.git/blob - Layouts.md

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Updated To start (markdown)
[etc/awesome.git] / Layouts.md
1 [<- home](https://github.com/copycat-killer/lain/wiki)
2
3 Currently, there are **7** layouts.
4
5     lain/layout
6     .
7     |-- cascade
8     |-- cascadetile
9     |-- centerwork
10     |-- termfair
11     |-- uselessfair
12     |-- uselesspiral
13     `-- uselesstile
14
15 Just add your favourites to ``layouts`` table:
16
17     layouts =
18     {
19         ...
20         lain.layout.termfair,
21         lain.layout.uselesstile,
22         ...
23     }
24
25 Or set them on specific tags like this:
26
27         awful.layout.set(lain.layout.uselessfair, tags[1][7])
28
29 How do layouts work?
30 =========================
31
32 cascade
33 -------
34
35 Cascade all windows of a tag.
36
37 You can control the offsets by setting those two variables:
38
39         lain.layout.cascade.cascade_offset_x = 64
40         lain.layout.cascade.cascade_offset_y = 16
41
42 The following reserves space for 5 windows:
43
44         lain.layout.cascade.nmaster = 5
45
46 That is, no window will get resized upon the creation of a new window,
47 unless there's more than 5 windows.
48
49 cascadetile
50 -----------
51
52 Similar to `awful.layout.suit.tile` layout, however, clients in the slave
53 column are cascaded instead of tiled.
54
55 Left column size can be set, otherwise is controlled by `mwfact` of the
56 tag. Additional windows will be opened in another column on the right.
57 New windows are placed above old windows.
58
59 Whether the slave column is placed on top of the master window or not is
60 controlled by the value of `ncol`. A value of 1 means "overlapping slave column"
61 and anything else means "don't overlap windows".
62
63 Usage example:
64
65         lain.layout.cascadetile.cascade_offset_x = 2
66         lain.layout.cascadetile.cascade_offset_y = 32
67         lain.layout.cascadetile.extra_padding = 5
68     lain.layout.cascadetile.nmaster = 5
69     lain.layout.ncol = 1
70
71 `extra_padding` reduces the size of the master window if "overlapping
72 slave column" is activated. This allows you to see if there are any
73 windows in your slave column.
74
75 Setting `cascade_offset_x` to a very small value or even 0 is reccommended to avoid wasting space.
76
77 centerwork
78 ----------
79
80 You start with one window, centered horizontally:
81
82         +--------------------------+
83         |       +----------+       |
84         |       |          |       |
85         |       |          |       |
86         |       |          |       |
87         |       |   MAIN   |       |
88         |       |          |       |
89         |       |          |       |
90         |       |          |       |
91         |       |          |       |
92         |       +----------+       |
93         +--------------------------+
94
95 This is your main working window. You do most of the work right here.
96 Sometimes, you may want to open up additional windows. They're put in
97 the following four slots:
98
99         +--------------------------+
100         | +---+ +----------+ +---+ |
101         | |   | |          | |   | |
102         | | 0 | |          | | 1 | |
103         | |   | |          | |   | |
104         | +---+ |   MAIN   | +---+ |
105         | +---+ |          | +---+ |
106         | |   | |          | |   | |
107         | | 2 | |          | | 3 | |
108         | |   | |          | |   | |
109         | +---+ +----------+ +---+ |
110         +--------------------------+
111
112 Yes, the number "four" is fixed. In total, you can only have five open
113 windows with this layout. Additional windows are not managed and set to
114 floating mode. **This is intentional**.
115
116 You can set the order of the four auxiliary windows. This is the default
117 configuration:
118
119         lain.layout.centerwork.top_left = 0
120         lain.layout.centerwork.top_right = 1
121         lain.layout.centerwork.bottom_left = 2
122         lain.layout.centerwork.bottom_right = 3
123
124 This means: The bottom left slot will be occupied by the third window
125 (not counting the main window). Suppose you want your windows to appear
126 in this order:
127
128         +--------------------------+
129         | +---+ +----------+ +---+ |
130         | |   | |          | |   | |
131         | | 3 | |          | | 0 | |
132         | |   | |          | |   | |
133         | +---+ |   MAIN   | +---+ |
134         | +---+ |          | +---+ |
135         | |   | |          | |   | |
136         | | 2 | |          | | 1 | |
137         | |   | |          | |   | |
138         | +---+ +----------+ +---+ |
139         +--------------------------+
140
141 This would require you to use these settings:
142
143         lain.layout.centerwork.top_left = 3
144         lain.layout.centerwork.top_right = 0
145         lain.layout.centerwork.bottom_left = 2
146         lain.layout.centerwork.bottom_right = 1
147
148 *Please note:* If you use Awesome's default configuration, navigation in
149 this layout may be very confusing. How do you get from the main window
150 to satellite ones depends on the order in which the windows are opened.
151 Thus, use of `awful.client.focus.bydirection()` is suggested.
152 Here's an example:
153
154         globalkeys = awful.util.table.join(
155         ...
156             awful.key({ modkey }, "j",
157                 function()
158                     awful.client.focus.bydirection("down")
159                     if client.focus then client.focus:raise() end
160                 end),
161             awful.key({ modkey }, "k",
162                 function()
163                     awful.client.focus.bydirection("up")
164                     if client.focus then client.focus:raise() end
165                 end),
166             awful.key({ modkey }, "h",
167                 function()
168                     awful.client.focus.bydirection("left")
169                     if client.focus then client.focus:raise() end
170                 end),
171             awful.key({ modkey }, "l",
172                 function()
173                     awful.client.focus.bydirection("right")
174                     if client.focus then client.focus:raise() end
175                 end),
176             ...
177         )
178
179 termfair
180 --------
181
182 I do a lot of work on terminals. The common tiling algorithms usually
183 maximize windows, so you'll end up with a terminal that has about 200
184 columns or more. That's way too much. Have you ever read a manpage in a
185 terminal of this size?
186
187 This layout restricts the size of each window. Each window will have the
188 same width but is variable in height. Furthermore, windows are
189 left-aligned. The basic workflow is as follows (the number above the
190 screen is the number of open windows, the number in a cell is the fixed
191 number of a client):
192
193              (1)                (2)                (3)
194         +---+---+---+      +---+---+---+      +---+---+---+
195         |   |   |   |      |   |   |   |      |   |   |   |
196         | 1 |   |   |  ->  | 2 | 1 |   |  ->  | 3 | 2 | 1 |  ->
197         |   |   |   |      |   |   |   |      |   |   |   |
198         +---+---+---+      +---+---+---+      +---+---+---+
199
200              (4)                (5)                (6)
201         +---+---+---+      +---+---+---+      +---+---+---+
202         | 4 |   |   |      | 5 | 4 |   |      | 6 | 5 | 4 |
203         +---+---+---+  ->  +---+---+---+  ->  +---+---+---+
204         | 3 | 2 | 1 |      | 3 | 2 | 1 |      | 3 | 2 | 1 |
205         +---+---+---+      +---+---+---+      +---+---+---+
206
207 The first client will be located in the left column. When opening
208 another window, this new window will be placed in the left column while
209 moving the first window into the middle column. Once a row is full,
210 another row above it will be created.
211
212 Default number of columns and rows are respectively taken from `nmaster`
213 and `ncol` values in `awful.tag`, but you can set your own.
214
215 For example, this sets `termfair` to 3 columns and at least 1 row:
216
217     lain.layout.termfair.nmaster = 3
218     lain.layout.termfair.ncol = 1
219
220 uselessfair, uselesspiral & uselesstile
221 ---------------------------------------
222 These are duplicates of the stock `fair`, `spiral` and `tile` layouts.
223
224 However, "useless gaps" (see below) have been added.
225
226 Useless gaps
227 ============
228
229 Useless gaps are gaps between windows. They are "useless" because they
230 serve no special purpose despite increasing overview. I find it easier
231 to recognize window boundaries if windows are set apart a little bit.
232
233 The `uselessfair` layout, for example, looks like this:
234
235         +================+
236         #                #
237         #  +---+  +---+  #
238         #  | 1 |  |   |  #
239         #  +---+  |   |  #
240         #         | 3 |  #
241         #  +---+  |   |  #
242         #  | 2 |  |   |  #
243         #  +---+  +---+  #
244         #                #
245         +================+
246
247 All of lain layouts provide useless gaps. To set the width of the gaps,
248 you have to add an item called `useless_gap_width` in your `theme.lua`.
249 If it doesn't exist, the width will default to 0.
250 Example:
251
252         theme.useless_gap_width = "5"
253
254 What about layout icons?
255 ========================
256
257 They are located in ``lain/icons/layout``.
258
259 To use them, add lines to your ``theme.lua`` like this:
260
261         theme.lain_icons         = os.getenv("HOME") .. "/.config/awesome/lain/icons/layout/default/"
262         theme.layout_termfair    = theme.lain_icons .. "termfairw.png"
263         theme.layout_cascade     = theme.lain_icons .. "cascadew.png"
264         theme.layout_cascadetile = theme.lain_icons .. "cascadetilew.png"
265         theme.layout_centerwork  = theme.lain_icons .. "centerworkw.png"
266
267 Credits goes to [Nicolas Estibals](https://github.com/nestibal) for creating
268 layout icons for default theme.
269
270 You can use them as a template for your custom versions.
271
272 [<- home](https://github.com/copycat-killer/lain/wiki)