Project

General

Profile

unexist.dev

/

subtle

Assorted tidbits and projects

Views » History » Version 5

Version 4 (Anonymous, 08/23/2012 03:49 PM) → Version 5/9 (Christoph Kappel, 01/23/2018 12:24 PM)

h1. Views

{{>toc}}

[[Views]]
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]].

There
names]].\015\012\015\012There are two ways to define a [[Views|view]] in the [[config]]:

h2. Simple

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]]:

<pre><code
[[Views|view]]:\015\012\015\012<pre><code class="ruby">view "view", "tag"</code></pre>

h2. Extended

Like
"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.

<pre><code class="ruby">
view
icon.\015\012\015\012<pre>{{hide}}<code class="ruby">\015\012view "view" do
do\015\012 match "xterm|[u]?rxvt"
"xterm|[u]?rxvt"\015\012 gravity :center
end
</code></pre>

h2. Default

The
: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*.

h2. Properties

Following
*automatically*.\015\012\015\012h2. Properties\015\012\015\012Following properties exist:

h3. Icon

This
exist:\015\012\015\012h3. Icon\015\012\015\012This property add an icon to the [[Views|view]] name in the [[Panel|panel]].

Example:

<pre><code
[[Panel|panel]].\015\012\015\012Example:\015\012\015\012<pre>{{hide}}<code class="ruby">view "terms" do
do\015\012 match "urxvt"
"urxvt"\015\012 icon "/usr/share/icons/icon.xbm"
end</code></pre>

{{info(You
"/usr/share/icons/icon.xbm"\015\012end</code></pre>\015\012\015\012{{info(You can also pass a "Subtlext::Icon":http://rdoc.subforge.org/subtle/classes/Subtlext/Icon.html object to *icon* _instead_ of a path.)}}

h3. Icon_only

This
path.)}}\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.

Example:

<pre><code
used.\015\012\015\012Example:\015\012\015\012<pre>{{hide}}<code class="ruby">view "terms" do
do\015\012 icon "/usr/share/icons/icon.xbm"
"/usr/share/icons/icon.xbm"\015\012 icon_only true
end</code></pre>

h3. Dynamic

This
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.

Example:

<pre><code
panel.\015\012\015\012Example:\015\012\015\012<pre>{{hide}}<code class="ruby">view "terms" do
do\015\012 dynamic true
end</code></pre>

{{warn([[subtle]]
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.)}}

h3. Match

This
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.

<pre><code
properties.\015\012\015\012<pre>{{hide}}<code class="ruby">view "terms" do
do\015\012 match "urxvt"
end</code></pre>

"urxvt"\015\012end</code></pre>\015\012\015\012