Project

General

Profile

unexist.dev

subtle

Assorted tidbits and projects

Gravity » History » Version 23

Version 22 (Zafer CAKMAK, 08/02/2010 02:15 AM) → Version 23/25 (Anonymous, 05/14/2011 12:07 AM)

h1. Gravity\015\012\015\012{{>toc}}\015\012\015\012[[subtle]] uses Gravity\015\012\015\012{{>toc}}\015\012\015\012Each Gravity has got a configureable grid system for window number of Gravities which assign a certain placement on the screen.\015\012\015\012h2. Gravities\015\012\015\012Gravities are the subtle way to arrange clients. Each client has to be assigned to one Gravity and the window slots inside one of this grid those Gravities. These Gravity are called [[gravity]].\015\012\015\012h2. Values\015\012\015\012[[Gravity|Gravities]] defined by a quadtuple @ x | y | width | height @ where x and y are percentage values of the used [[screen]] screen position in percent from the top left, x being down and work [[view]]-wise for assigned [[tagging|tag]]. They consist y being left. Width and Height are the sizes of four values:\015\012\015\012* *X* for placement in X direction\015\012* *Y* for placement in Y direction\015\012* *WIDTH* for window width\015\012* *HEIGHT* for window height\015\012\015\012Each value is a percentage value of the client relative to the screen width size.\015\012\015\012h2. How Gravities are applied\015\012\015\012We took the intuitive approach, as clients are sized to w and height, that ensures that h and the center is being 'pulled' to the gravity point.\015\012\015\012+Examples:+\015\012\015\012* TopLeft (x = 0, y = 0, h = 50, w = 50)\015\012 <pre>\015\012 +---+---+\015\012 | c | |\015\012 +---+ |\015\012 | |\015\012 +-------+\015\012 </pre>\015\012\015\012* Center (x=50, y = 50, h = 50, w = 50)\015\012 <pre>\015\012 +-------+\015\012 | +---+ |\015\012 | | c | |\015\012 | +---+ |\015\012 +-------+\015\012 </pre>\015\012\015\012h2. How you change Gravities\015\012\015\012h3. via [[config]]\015\012\015\012Check the default subtle.rb file, constant @GRAVITIES@. There's a simpler Gravities configuration implementation too: http://pastie.org/662640\015\012\015\012h3. via [[Grabs]]\015\012\015\012You 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 [[gravity|gravities]] work on any [[screen]].\015\012\015\012h2. Examples\015\012\015\012h3. Center\015\012\015\012<pre><code class="ruby">gravity :center, Grab will result in cycling through the rectangles.\015\012\015\012h3. via [[Subtlext]]\015\012\015\012You can set the Gravity via @client.gravity = object@, where @object@ may be:\015\012* an Integer (Gravity ID)\015\012* a Hash @{:gravity => Int, :geometry => Int}@\015\012* a @Subtlext::Gravity@ object\015\012\015\012h3. via [[Subtler]]\015\012\015\012TODO\015\012\015\012h2. Default Gravities\015\012\015\012* Top left (W-KP_7)\015\012gravity :top_left, [ 25, 25, 0, 0, 50, 50 ]</code></pre>\015\012\015\012\015\012<pre>+---------+\015\012| |\015\012| +-----+ |\015\012| | ]\015\012gravity :top_left66, | |\015\012| +-----+ |\015\012| |\015\012+---------+</pre>\015\012\015\012h3. [ 0, 0, 50, 66 ]\015\012gravity :top_left33, [ 0, 0, 50, 34 ]\015\012\015\012* Top left\015\012\015\012<pre><code class="ruby">gravity :center, (W-KP_8)\015\012gravity :top, [ 0, 0, 100, 50 ]\015\012gravity :top66, [ 0, 0, 100, 66 ]\015\012gravity :top33, [ 0, 0, 100, 34 ]\015\012\015\012* Top right (W-KP_9)\015\012gravity :top_right, [ 100, 0, 50, 50 ]</code></pre>\015\012\015\012<pre>+----+----+\015\012| ]\015\012gravity :top_right66, | [ 100, 0, 50, 66 ]\015\012gravity :top_right33, |\015\012| | |\015\012+----+ |\015\012| [ 100, 0, 50, 34 ]\015\012\015\012* Left (W-KP_4)\015\012gravity :left, [ 0, 0, 50, 100 ]\015\012gravity :left66, |\015\012| [ 0, 50, 50, 34 ]\015\012gravity :left33, |\015\012+---------+</pre>\015\012\015\012h3. Bottom\015\012\015\012<pre><code class="ruby">gravity [ 0, 50, 25, 34 ]\015\012\015\012* Center (W-KP_5)\015\012gravity :center, [ 0, 0, 100, 100 ]\015\012gravity :center66, [ 0, 50, 100, 34 ]\015\012gravity :center33, [ 50, 50, 50, 34 ]\015\012\015\012* Right (W-KP_6)\015\012gravity :right, [ 100, 0, 50, 100 ]\015\012gravity :right66, [ 100, 50, 50, 34 ]\015\012gravity :right33, [ 100, 50, 25, 34 ]\015\012\015\012* Bottom left (W-KP_1)\015\012gravity :bottom_left, [ 0, 100, 50, 50 ]</code></pre>\015\012\015\012<pre>+---------+\015\012| ]\015\012gravity :bottom_left66, [ 0, 100, 50, 66 ]\015\012gravity :bottom_left33, [ 0, 100, 50, 34 ]\015\012\015\012* Bottom (W-KP_2)\015\012gravity :bottom, |\015\012| |\015\012+---------+\015\012| |\015\012| |\015\012+---------+</pre>\015\012 [ 0, 100, 100, 50 ]\015\012gravity :bottom66, [ 0, 100, 100, 66 ]\015\012gravity :bottom33, [ 0, 100, 100, 34 ]\015\012\015\012* Bottom right (W-KP_3)\015\012gravity :bottom_right, [ 100, 100, 50, 50 ]\015\012gravity :bottom_right66, [ 100, 100, 50, 66 ]\015\012gravity :bottom_right33, [ 100, 100, 50, 34 ]\015\012