Project

General

Profile

unexist.dev

Assorted tidbits and projects

Grabs » History » Version 37

Version 36 (Anonymous, 05/30/2010 03:17 PM) → Version 37/56 (Anonymous, 05/30/2010 05:15 PM)

h1. Grabs\015\012\015\012{{>toc}}\015\012\015\012[[Grabs]] are the mouse button/keyboard mappings in [[subtle]] and can be used in various combinations, no grab is limited either to button or keyboard.\015\012\015\012Genereally there are different types of [[grabs]]:\015\012# Predefined grabs\015\012# [[Grabs]] that call a "Ruby":http://www.ruby-lang.org block\015\012# [[Grabs]] that exec a program\015\012\015\012h2. program\015\012\015\012Remember that the config is a complete "Ruby":http://www.ruby-lang.org file.\015\012\015\012The syntax of the config can be checked with: *subtle -k* or *subtle -k -c* @/path/to/config@\015\012\015\012h2. Keys\015\012\015\012The best resource for getting the correct key names is probably the @/usr/include/X11/keysymdef.h@, but to make life easier here are some infos about it:\015\012\015\012* Numbers and letters keep their names, so *a* is *a* and *0* is *0*\015\012* Keypad keys need *KP_* as prefix, so *KP_1* is *1* on the keypad\015\012* Strip the *XK_* from the key names if looked up in @/usr/include/X11/keysymdef.h@\015\012* Keys usually have meaningful english names\015\012* Modifier keys have special meaning (Alt, Control, Meta, Shift, Super)\015\012\015\012+Common keys+:\015\012* *Space*\015\012* *Tab*\015\012* *Enter* / *Return*\015\012* *F1* - *F12*\015\012* *Left*, *Down*, *Up*, *Right*\015\012* *Next*, *Prior*\015\012* *Page_Up*, *Page_Down*\015\012* *Home*, *End*\015\012* *Insert*, *Delete*\015\012* *Add*, *Subtract*, *Multiply*, *Divide*, *Equal*\015\012* *Decimal*\015\012* *Num_Lock*\015\012* *Escape*\015\012\015\012h2. Chains\015\012\015\012[[Grabs|Grab]] chains are combinations the combination of one or more modifiers and a button/key. key/button. The following two lists show the modifier/buttons that are available:\015\012\015\012+Modifier keys+:\015\012* A = Alt key\015\012* C = Control key\015\012* M = Meta key\015\012* S = Shift key\015\012* W = Super (Windows key)\015\012\015\012+Mouse buttons+:\015\012* B1 = Button1 (Left mouse button)\015\012* B2 = Button2 (Middle mouse button)\015\012* B3 = Button3 (Right mouse button)\015\012* B4 = Button4\015\012* B5 = Button5\015\012\015\012+Example+:\015\012<pre><code class="ruby">\015\012"S-B1" => WindowMove\015\012"A-space" => lambda { |c| c.toggle_float }\015\012"A-v" => lambda { puts version }\015\012"W-F1" => "xterm -sb"\015\012</code></pre>\015\012\015\012h2. Predefined\015\012\015\012h3. Views\015\012\015\012Move pointer Views\015\012\015\012Jump to the numbered view.\015\012\015\012* *ViewJump1*\015\012* *ViewJump2*\015\012* *...*\015\012* *ViewJumpN*\015\012\015\012h3. Screens\015\012\015\012Move pointer to the numbered screen.\015\012\015\012* *ScreenJump1*\015\012* *ScreenJump2*\015\012* *..*\015\012* *ScreenJumpN*\015\012\015\012Move window to the numbered screen.\015\012\015\012* *WindowScreen1*\015\012* *WindowScreen2*\015\012* *..*\015\012* *WindowScreenN*\015\012\015\012h3. Windows\015\012\015\012Window [[grabs]] [[Grabs|grabs]] manipulate/toggle various properties of client windows.\015\012\015\012* *WindowMove*\015\012* *WindowResize*\015\012* *WindowFloat*\015\012* *WindowFull*\015\012* *WindowStick*\015\012* *WindowRaise*\015\012* *WindowLower*\015\012* *WindowLeft*\015\012* *WindowDown*\015\012* *WindowUp*\015\012* *WindowRight*\015\012* *WindowKill*\015\012\015\012h3. Gravities\015\012\015\012[[Gravity]] [[grabs]] change [[Grabs|grabs]] manipulate the [[gravity]] [[Gravity|gravity]] of the selected client on the current view, they are basically a list of [[Gravity|gravities]] and are toggled.\015\012\015\012+Example+:\015\012<pre><code class="ruby">"W-KP_7" => [ :top_left, :top_left66, :top_left33 ]</code></pre>\015\012\015\012h2. Blocks\015\012\015\012[[Grabs]] view.\015\012\015\012* *GravityTopLeft*\015\012* *GravityTop*\015\012* *GravityTopRight*\015\012* *GravityLeft*\015\012* *GravityCenter*\015\012* *GravityRight*\015\012* *GravityBottomLeft*\015\012* *GravityBottom*\015\012* *GravityBottomRight*\015\012\015\012h2. Block\015\012\015\012[[Grabs]] can also call have a complete "Ruby":http://www.ruby-lang.org block (aka lambda/proc), the arity of the block is either which has a client window or none. Inside of *client* as parameter and can access the blocks the whole API complete functionality of [[subtlext]] can be used, the [[Subtlext|subtlext]]. \015\012_The extension will ony be loaded _ondemand_.\015\012\015\012+Example+:\015\012<pre><code on-demand._\015\012\015\012+Example+:\015\012<pre><code class="ruby">\015\012"S-F1" => lambda { |c| puts c.name }\015\012</code></pre>\015\012\015\012h2. |c|\015\012 v = add_view("test")\015\012\015\012 c + "test"\015\012 v + "test"\015\012\015\012 v.jump\015\012} \015\012</code></pre>\015\012\015\012h2. Exec\015\012\015\012Invoke a shell and exec a program.\015\012\015\012* *xterm +sb* +sb*\015\012\015\012{{tocnavi(subtle,Subtlext,Quickstart,Tags)}}