Project

General

Profile

unexist.dev

subtle

Assorted tidbits and projects

Views » History » Version 2

Anonymous, 06/24/2011 02:37 PM

1 2
h1. Views\015\012\015\012{{>toc}}\015\012\015\012[[Views]] are the virtual desktops in [[subtle]] and they display [[Tagging|matching]] [[clients]] based on [[tagging|tags]]. In comparison to the [[Tagging|matching]] in [[Tagging|tags]], [[Views|views]] match [[Tagging|tag names]].\015\012\015\012There are two ways to define a [[Views|view]] in the [[config]]:\015\012\015\012h2. Simple\015\012\015\012The simple way just needs a name and a "regular expression":http://en.wikipedia.org/wiki/Regular_expression (see "regex(7)":http://linux.die.net/man/7/regex) to create a [[Views|view]]:\015\012\015\012<pre><code class="ruby">view "view", "tag"</code></pre>\015\012\015\012h2. Extended\015\012\015\012Like [[Tagging|tags]], [[Views|views]] can have additionally properties to set a different mode or even add an icon.\015\012\015\012<pre>{{hide}}<code class="ruby">\015\012view "view" do\015\012  match   "xterm|[u]?rxvt"\015\012  gravity :center\015\012end\015\012</code></pre>\015\012\015\012h2. Default\015\012\015\012The +default+ [[Views|view]] can either be set by adding the +default+ [[Tagging|tag]] to a [[Views|view]] by choice or otherwise the first defined [[Views|view]] is chosen *automatically*.\015\012\015\012h2. Properties\015\012\015\012Following properties exist:\015\012\015\012h3. Icon\015\012\015\012This property add an icon to the [[Views|view]] name in the [[Panel|panel]].\015\012\015\012Example:\015\012\015\012<pre>{{hide}}<code class="ruby">view "terms" do\015\012  match "urxvt"\015\012  icon  Subtlext::Icon.new("/usr/share/icons/icon.xbm")\015\012end</code></pre>\015\012\015\012h3. Icon_only\015\012\015\012This property hides the [[Views|view]] name from the [[Panel|panel]] when an icon is used.\015\012\015\012Example:\015\012\015\012<pre>{{hide}}<code class="ruby">view "terms" do\015\012  icon      Subtlext::Icon.new("/usr/share/icons/icon.xbm")\015\012  icon_only true\015\012end</code></pre>\015\012\015\012h3. Dynamic\015\012\015\012This property hides [[Views|views]] that aren't occupied by [[Clients|clients]] from the panel.\015\012\015\012Example:\015\012\015\012<pre>{{hide}}<code class="ruby">view "terms" do\015\012  dynamic true\015\012end</code></pre>\015\012\015\012{{warn([[subtle]] doesn't change the numbering of the [[Views|views]], that means when there are three [[Views|views]] and the second is [[Views#Dynamic|dynamic]] the third is *still* the third.)}}\015\012\015\012h3. Match\015\012\015\012This property works like the [[Tagging#Simple|simple tag matching]], but matches [[Tagging|tag names]] *instead* of actual [[Clients|client]] properties.\015\012\015\012<pre>{{hide}}<code class="ruby">view "terms" do\015\012  match   "urxvt"\015\012end</code></pre>\015\012\015\012