Tagging » History » Version 25
Version 24 (Anonymous, 05/24/2010 05:07 PM) → Version 25/66 (Anonymous, 06/18/2010 08:37 PM)
h1. Tagging\015\012\015\012{{>toc}}\015\012\015\012[[Tags]] are generally used in [[subtle]] for placement of windows. This placement is *mandatory*, that means that - aside from other tiling window managers - windows _must have_ a matching [[Tags|tag]] to be on a certain [[Views|view]]. This also includes that windows that are started on a certain view will not automatically be placed there.\015\012\015\012There are to ways to define a [[Tags|tag]] in the [[config]]:\015\012* with a "string":http://www.ruby-doc.org/core/classes/String.html\015\012<pre><code class="ruby">\015\012tag "tag", class="ruby">\015\012"tag" => "xterm"\015\012</code></pre>\015\012* with a "hash":http://www.ruby-doc.org/core/classes/Hash.html of properties\015\012<pre>{{hide}}<code class="ruby">\015\012tag "tag" do\015\012 regex "xterm|[u]?rxvt"\015\012 gravity :center\015\012end\015\012</code></pre>\015\012\015\012h2. properties\015\012<pre><code class="ruby">\015\012"tag" => { :regex => "xterm|[u]?rxvt", :gravity => :center }\015\012</code></pre>\015\012\015\012h2. Default\015\012\015\012Whenever a window has no [[Tagging|tags]] it will get the +default+ [[Tagging|tag]] and be placed on the default view. The +default+ view can either be set by the user with adding the +default+ [[Tagging|tag]] to a view by choice or otherwise the first defined view will be chosen automatically.\015\012\015\012Example:\015\012\015\012<pre>{{hide}}<code class="ruby">\015\012view "terms", "terms",\015\012view automatically.\015\012\015\012Example:\015\012\015\012<pre><code class="ruby">VIEWS = {\015\012 "www", "default|browser",\015\012view "terms" => "terms",\015\012 "dev", "editor"\015\012</code></pre>\015\012\015\012h2. "www" => "default|browser",\015\012 "dev" => "editor"\015\012}\015\012</code></pre>\015\012\015\012h2. Properties\015\012\015\012Additionally [[tagging|tags]] can do a lot more then just control the placement - they also have properties than can define and control some aspects of a window like the default [[gravity]] or the default screen per view.\015\012\015\012h3. float\015\012\015\012This property either sets the tagged client floating or prevents it from being floating depending on the value.\015\012<pre>{{hide}}<code class="ruby">\015\012tag "float" do\015\012 regex "xterm"\015\012 float true\015\012end\015\012\015\012tag "nofloat" do\015\012 regex "xterm"\015\012 float false\015\012end\015\012</code></pre>\015\012\015\012h3. value.\015\012<pre><code class="ruby">\015\012"float" => { :regex => "xterm", :float => true }\015\012"nofloat" => { :regex => "xterm", :float => false }\015\012</code></pre>\015\012\015\012h3. full\015\012\015\012This property either sets the tagged client to fullscreen or prevents it from being set to fullscreen depending on the value.\015\012<pre>{{hide}}<code class="ruby">\015\012tag "full" do\015\012 regex "xterm"\015\012 full true\015\012end\015\012\015\012tag "nofull" do\015\012 regex "xterm"\015\012 full false\015\012end\015\012</code></pre>\015\012\015\012h3. value.\015\012<pre><code class="ruby">\015\012"full" => { :regex => "xterm", :full => true }\015\012"nofull" => { :regex => "xterm", :full => false }\015\012</code></pre>\015\012\015\012h3. gravity\015\012\015\012This property sets a certain to [[gravity]] to the tagged client, but +only+ on views that have this tag too.\015\012<pre>{{hide}}<code class="ruby">\015\012tag "gravity" do\015\012 regex "xterm"\015\012 gravity :center\015\012end\015\012</code></pre>\015\012\015\012h3. too.\015\012<pre><code class="ruby">\015\012"gravity" => { :regex => "xterm", :gravity => :center }\015\012</code></pre>\015\012\015\012h3. match\015\012\015\012This property influcences the matching of [[tagging]], per default [[tagging]] will only match the "WM_NAME":http://standards.freedesktop.org/wm-spec/1.3/ar01s05.html and the "WM_CLASS":http://standards.freedesktop.org/wm-spec/1.3/ar01s05.html portion of a client. \015\012\015\012Match expects an "array":http://www.ruby-doc.org/core/classes/Array.html with following possible values:\015\012\015\012| *:title* | match the title which is also visible in the [[panel]] |\015\012| *:name* | match the {{color(#ff0000, WM_NAME)}} |\015\012| *:class* | match the {{color(#0000ff, WM_CLASS)}} |\015\012\015\012There are several ways to get these values, here are the most common:\015\012\015\012* "xprop":http://www.xfree86.org/current/xprop.1.html: Just select the window and have a look for the "WM_CLASS":http://standards.freedesktop.org/wm-spec/1.3/ar01s05.html line which usually look like this:\015\012\015\012p{class:pre}. WM_CLASS(STRING) = "{{color(#ff0000, urxvt)}}", "{{color(#0000ff, URxvt)}}")\015\012\015\012* [[subtler]]: Run *[[subtler]] -cl* and look for the matching line:\015\012\015\012p{class:pre}. 0x800007 * 1 100x100 5 0 --- {{color(#ff0000, xterm)}} ({{color(#0000ff,XTerm)}})\015\012\015\012<pre>{{hide}}<code class="ruby">\015\012tag "match" do\015\012 regex "xterm"\015\012 match ({{color(#0000ff,XTerm)}})\015\012\015\012<pre><code class="ruby">\015\012"match" => { :regex => "xterm", :match => [ :title, :class ]\015\012end\015\012</code></pre>\015\012\015\012h3. ] }\015\012</code></pre>\015\012\015\012h3. regex \015\012\015\012This property sets the matching pattern for a [[Tagging|tag]]. Matching works either via plain, regex (see "regex(7)":http://linux.die.net/man/7/regex) or window id. If a pattern matches more than once ONLY the first match will be used. \015\012<pre>{{hide}}<code class="ruby">\015\012tag "regex" \015\012 regex "xterm"\015\012end\015\012</code></pre>\015\012\015\012h3. \015\012<pre><code class="ruby">\015\012"regex" => { :regex => "xterm" }\015\012</code></pre>\015\012\015\012h3. resize\015\012\015\012This property either enables or disables honoring of client resize hints and is independent of the global option.\015\012<pre>{{hide}}<code class="ruby">\015\012tag "resize" do\015\012 regex "xterm"\015\012 resize true\015\012end\015\012</code></pre>\015\012\015\012h3. option.\015\012<pre><code class="ruby">\015\012"resize" => { :regex => "xterm", :resize => true }\015\012</code></pre>\015\012\015\012h3. screen\015\012\015\012This property sets a certain to screen to the [[Tagging|tagged]] client, but +only+ on views that have this tag too. _Please keep in mind that screen count starts with 0 for the first screen._\015\012<pre>{{hide}}<code class="ruby">\015\012tag "screen" do\015\012 regex "xterm"\015\012 screen 1\015\012end\015\012</code></pre>\015\012\015\012h3. screen._\015\012<pre><code class="ruby">\015\012"screen" => { :regex => "xterm", :screen => 1 }\015\012</code></pre>\015\012\015\012h3. size\015\012\015\012This property sets a certain to size as well as floating to the [[Tagging|tagged]] cient, but +only+ on [[views]] that have this tag too. It expects an "array":http://www.ruby-doc.org/core/classes/Array.html with *x*, *y*, *width* and *height* values.\015\012<pre>{{hide}}<code class="ruby">\015\012tag "size" do\015\012 regex "xterm"\015\012 size values.\015\012<pre><code class="ruby">\015\012"size" => { :regex => "xterm", :size => [ 10, 10, 100, 100 ]\015\012end\015\012</code></pre>\015\012\015\012h3. ] }\015\012</code></pre>\015\012\015\012h3. stick\015\012\015\012This property either sets the [[Tagging|tagged]] client to stick or prevents it from being set to stick depending on the value. Stick clients are visible on +every+ view.\015\012<pre>{{hide}}<code class="ruby">\015\012tag "stick" do\015\012 regex "xterm"\015\012 stick true\015\012end\015\012\015\012tag "nostick" do\015\012 regex "xterm"\015\012 stick false\015\012end\015\012</code></pre>\015\012\015\012h3. view.\015\012<pre><code class="ruby">\015\012"stick" => { :regex => "xterm", :stick => true }\015\012"nostick" => { :regex => "xterm", :stick => false }\015\012</code></pre>\015\012\015\012h3. urgent\015\012\015\012This property either sets the [[Tagging|tagged]] client to be urgent or prevents it from being urgent depending on the value. Urgent clients will get keyboard and mouse focus +automatically+.\015\012<pre>{{hide}}<code class="ruby">\015\012tag "urgent" do \015\012 regex "xterm"\015\012 urgent true\015\012end\015\012\015\012tag "nourgent" do\015\012 regex "xterm"\015\012 urgent false\015\012end\015\012</code></pre>\015\012\015\012h2. Examples\015\012\015\012<pre>{{hide}}<code class="ruby">\015\012tag "bashrun" do\015\012 regex "bashrun"\015\012 size +automatically+.\015\012<pre><code class="ruby">\015\012"urgent" => { :regex => "xterm", :urgent => true }\015\012"nourgent" => { :regex => "xterm", :urgent => false }\015\012</code></pre>\015\012\015\012h2. Examples\015\012\015\012<pre><code class="ruby">\015\012"bashrun" => { :regex => "bashrun", :size => [ 50, 1000, 200, 28 ]#\015\012 ], :stick => true, :float => true, :urgent => true, :screen => 0 stick true\015\012 float true\015\012 urgent true\015\012 screen 0\015\012end\015\012\015\012tag "browser" do\015\012 regex "uzbl|midori"\015\012 gravity :center\015\012 screen 1\015\012end\015\012</code></pre> }\015\012"browser" => { :regex => "uzbl|midori", :gravity => :center, :screen => 1 }\015\012</code></pre>