Gravity

Version 17 (Christoph Kappel, 2009-10-18 19:30)

1 1
h1. Gravity
2 2 Christoph Kappel
3 12 Simon Hafner
{{>toc}}
4 12 Simon Hafner
5 14 Simon Hafner
Each Gravity has got a number of Rectangles which assign a certain placement on the screen.
6 12 Simon Hafner
7 14 Simon Hafner
h2. Rectangles
8 12 Simon Hafner
9 14 Simon Hafner
Rectangles are the subtle way to arrange clients. Each client has to be assigned to one Gravity and one of those Rectangles. These Rectangle are defined by a quadtuple @ x | y | width | height @ where x and y are the screen position in percent from the top left, x being down and y being left. Width and Height are the sizes of the client relative to the screen size.
10 12 Simon Hafner
11 14 Simon Hafner
h2. How Rectangles are applied
12 12 Simon Hafner
13 14 Simon Hafner
We took the intuitive approach, as clients are sized to w and h and the center is being 'pulled' to the gravity point.
14 12 Simon Hafner
15 12 Simon Hafner
+Examples:+
16 12 Simon Hafner
17 12 Simon Hafner
* TopLeft (x = 0, y = 0, h = 50, w = 50)
18 12 Simon Hafner
  <pre>
19 12 Simon Hafner
  +---+---+
20 12 Simon Hafner
  | c |   |
21 12 Simon Hafner
  +---+   |
22 12 Simon Hafner
  |       |
23 12 Simon Hafner
  +-------+
24 12 Simon Hafner
  </pre>
25 12 Simon Hafner
26 12 Simon Hafner
* Center (x=50, y = 50, h = 50, w = 50)
27 12 Simon Hafner
  <pre>
28 12 Simon Hafner
  +-------+
29 12 Simon Hafner
  | +---+ |
30 12 Simon Hafner
  | | c | |
31 12 Simon Hafner
  | +---+ |
32 12 Simon Hafner
  +-------+
33 12 Simon Hafner
  </pre>
34 12 Simon Hafner
35 12 Simon Hafner
h2. How you change Gravities
36 12 Simon Hafner
37 15 Simon Hafner
h3. via [[config]]
38 12 Simon Hafner
39 12 Simon Hafner
Check the default subtle.rb file, constant @GRAVITIES@.
40 12 Simon Hafner
41 12 Simon Hafner
h3. via [[Grabs]]
42 12 Simon Hafner
43 14 Simon Hafner
You can set a Gravity by default by pressing Super and the numlock key in direction you desire your window to be. Pressing again the same Grab will result in cycling through the rectangles.
44 12 Simon Hafner
45 13 Simon Hafner
h3. via [[Subtlext]]
46 12 Simon Hafner
47 12 Simon Hafner
You can set the Gravity via @client.gravity = object@, where @object@ may be:
48 12 Simon Hafner
* an Integer (Gravity ID)
49 17 Christoph Kappel
* a Hash @{:gravity => Int, :geometry => Int}@
50 12 Simon Hafner
* a @Subtlext::Gravity@ object
51 16 Christoph Kappel
* a @Subtlext::Geometry@ object
52 12 Simon Hafner
53 13 Simon Hafner
h3. via [[Subtler]]
54 12 Simon Hafner
55 12 Simon Hafner
TODO
56 12 Simon Hafner
57 8 Christoph Kappel
58 10 Christoph Kappel
{{tocnavi(subtle,Tags,Quickstart,Quickstart)}}