My configuration files for Debian/Ubuntu applications
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

Layouts.md 8.4 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. lain/layout
  2. .
  3. |-- termfair
  4. |-- termfair.center
  5. |-- cascade
  6. |-- cascade.tile
  7. |-- centerwork
  8. |-- centerwork.horizontal
  9. Usage
  10. =====
  11. As usual, specify your favourites in `awful.layout.layouts`, or set them on specific tags with [`awful.layout.set`](https://awesomewm.org/doc/api/libraries/awful.layout.html#set).
  12. ```lua
  13. awful.layout.set(lain.layout.termfair, tag)
  14. ```
  15. How do layouts work?
  16. ====================
  17. `termfair`
  18. --------
  19. This layout restricts the size of each window. Each window will have the
  20. same width but is variable in height. Furthermore, windows are
  21. left-aligned. The basic workflow is as follows (the number above the
  22. screen is the number of open windows, the number in a cell is the fixed
  23. number of a client):
  24. (1) (2) (3)
  25. +---+---+---+ +---+---+---+ +---+---+---+
  26. | | | | | | | | | | | |
  27. | 1 | | | -> | 2 | 1 | | -> | 3 | 2 | 1 | ->
  28. | | | | | | | | | | | |
  29. +---+---+---+ +---+---+---+ +---+---+---+
  30. (4) (5) (6)
  31. +---+---+---+ +---+---+---+ +---+---+---+
  32. | 4 | | | | 5 | 4 | | | 6 | 5 | 4 |
  33. +---+---+---+ -> +---+---+---+ -> +---+---+---+
  34. | 3 | 2 | 1 | | 3 | 2 | 1 | | 3 | 2 | 1 |
  35. +---+---+---+ +---+---+---+ +---+---+---+
  36. The first client will be located in the left column. When opening
  37. another window, this new window will be placed in the left column while
  38. moving the first window into the middle column. Once a row is full,
  39. another row above it will be created.
  40. Default number of columns and rows are respectively taken from `nmaster`
  41. and `ncol` values in `awful.tag`, but you can set your own.
  42. For example, this sets `termfair` to 3 columns and at least 1 row:
  43. ```lua
  44. lain.layout.termfair.nmaster = 3
  45. lain.layout.termfair.ncol = 1
  46. ```
  47. `termfair.center`
  48. ----------
  49. Similar to `termfair`, but with fixed number of vertical columns. Cols are centerded until there are `nmaster` columns, then windows are stacked as slaves, with possibly `ncol` clients per column at most.
  50. (1) (2) (3)
  51. +---+---+---+ +-+---+---+-+ +---+---+---+
  52. | | | | | | | | | | | | |
  53. | | 1 | | -> | | 1 | 2 | | -> | 1 | 2 | 3 | ->
  54. | | | | | | | | | | | | |
  55. +---+---+---+ +-+---+---+-+ +---+---+---+
  56. (4) (5)
  57. +---+---+---+ +---+---+---+
  58. | | | 3 | | | 2 | 4 |
  59. + 1 + 2 +---+ -> + 1 +---+---+
  60. | | | 4 | | | 3 | 5 |
  61. +---+---+---+ +---+---+---+
  62. Like `termfair`, default number of columns and rows are respectively taken from `nmaster`
  63. and `ncol` values in `awful.tag`, but you can set your own.
  64. For example, this sets `termfair.center` to 3 columns and at least 1 row:
  65. ```lua
  66. lain.layout.termfair.center.nmaster = 3
  67. lain.layout.termfair.center.ncol = 1
  68. ```
  69. `cascade`
  70. -------
  71. Cascade all windows of a tag.
  72. You can control the offsets by setting these two variables:
  73. ```lua
  74. lain.layout.cascade.offset_x = 64
  75. lain.layout.cascade.offset_y = 16
  76. ```
  77. The following reserves space for 5 windows:
  78. ```lua
  79. lain.layout.cascade.nmaster = 5
  80. ```
  81. That is, no window will get resized upon the creation of a new window,
  82. unless there's more than 5 windows.
  83. `cascade.tile`
  84. -----------
  85. Similar to `awful.layout.suit.tile` layout, however, clients in the slave
  86. column are cascaded instead of tiled.
  87. Left column size can be set, otherwise is controlled by `mwfact` of the
  88. tag. Additional windows will be opened in another column on the right.
  89. New windows are placed above old windows.
  90. Whether the slave column is placed on top of the master window or not is
  91. controlled by the value of `ncol`. A value of 1 means "overlapping slave column"
  92. and anything else means "don't overlap windows".
  93. Usage example:
  94. ```lua
  95. lain.layout.cascade.tile.offset_x = 2
  96. lain.layout.cascade.tile.offset_y = 32
  97. lain.layout.cascade.tile.extra_padding = 5
  98. lain.layout.cascade.tile.nmaster = 5
  99. lain.layout.cascade.tile.ncol = 2
  100. ```
  101. `extra_padding` reduces the size of the master window if "overlapping
  102. slave column" is activated. This allows you to see if there are any
  103. windows in your slave column.
  104. Setting `offset_x` to a very small value or even 0 is recommended to avoid wasting space.
  105. `centerwork`
  106. ----------
  107. You start with one window, centered horizontally:
  108. +--------------------------+
  109. | +----------+ |
  110. | | | |
  111. | | | |
  112. | | | |
  113. | | MAIN | |
  114. | | | |
  115. | | | |
  116. | | | |
  117. | | | |
  118. | +----------+ |
  119. +--------------------------+
  120. This is your main working window. You do most of the work right here.
  121. Sometimes, you may want to open up additional windows. They're put on left and right, alternately.
  122. +--------------------------+
  123. | +---+ +----------+ +---+ |
  124. | | | | | | | |
  125. | | | | | | | |
  126. | | | | | | | |
  127. | +---+ | MAIN | +---+ |
  128. | +---+ | | +---+ |
  129. | | | | | | | |
  130. | | | | | | | |
  131. | | | | | | | |
  132. | +---+ +----------+ +---+ |
  133. +--------------------------+
  134. *Please note:* If you use Awesome's default configuration, navigation in
  135. this layout may be very confusing. How do you get from the main window
  136. to satellite ones depends on the order in which the windows are opened.
  137. Thus, use of `awful.client.focus.bydirection()` is suggested.
  138. Here's an example:
  139. ```lua
  140. globalkeys = awful.util.table.join(
  141. -- [...]
  142. awful.key({ modkey }, "j",
  143. function()
  144. awful.client.focus.bydirection("down")
  145. if client.focus then client.focus:raise() end
  146. end),
  147. awful.key({ modkey }, "k",
  148. function()
  149. awful.client.focus.bydirection("up")
  150. if client.focus then client.focus:raise() end
  151. end),
  152. awful.key({ modkey }, "h",
  153. function()
  154. awful.client.focus.bydirection("left")
  155. if client.focus then client.focus:raise() end
  156. end),
  157. awful.key({ modkey }, "l",
  158. function()
  159. awful.client.focus.bydirection("right")
  160. if client.focus then client.focus:raise() end
  161. end),
  162. -- [...]
  163. )
  164. ```
  165. `centerwork.horizontal`
  166. -----------
  167. Same as `centerwork`, except that the main
  168. window expands horizontally, and the additional windows
  169. are put ontop/below it. Useful if you have a screen turned 90°.
  170. Pre 4.0 `uselesstile` patches
  171. =============================
  172. In branch 3.5, this module provided useless gaps layouts. Since useless gaps have been implemented in Awesome 4.0, those layouts have been removed.
  173. Following are a couple of `uselesstile` variants that were not part of lain. They are kept only for reference and are not supported.
  174. Xmonad-like
  175. -----------
  176. If you want to have `awful.layout.suit.tile` behave like xmonad, with internal gaps two times wider than external ones, download [this](https://gist.github.com/lcpz/9e56dcfbe66bfe14967c) as `lain/layout/uselesstile`.
  177. Inverted master
  178. ---------------
  179. Want to invert master window position? Use [this](https://gist.github.com/lcpz/c59dc59c9f99d98218eb) version. You can set `single_gap` with `width` and `height` in your `theme.lua`, in order to define the window geometry when there's only one client, otherwise it goes maximized. An example:
  180. theme.single_gap = { width = 600, height = 100 }
  181. What about layout icons?
  182. ========================
  183. They are located in ``lain/icons/layout``.
  184. To use them, define new `layout_*` variables in your ``theme.lua``. For instance:
  185. ```lua
  186. theme.lain_icons = os.getenv("HOME") ..
  187. "/.config/awesome/lain/icons/layout/default/"
  188. theme.layout_termfair = theme.lain_icons .. "termfair.png"
  189. theme.layout_centerfair = theme.lain_icons .. "centerfair.png" -- termfair.center
  190. theme.layout_cascade = theme.lain_icons .. "cascade.png"
  191. theme.layout_cascadetile = theme.lain_icons .. "cascadetile.png" -- cascade.tile
  192. theme.layout_centerwork = theme.lain_icons .. "centerwork.png"
  193. theme.layout_centerworkh = theme.lain_icons .. "centerworkh.png" -- centerwork.horizontal
  194. ```
  195. Credit goes to [Nicolas Estibals](https://github.com/nestibal) for creating
  196. layout icons for default theme.
  197. You can use them as a template for your custom versions.