Project

General

Profile

unexist.dev

subtle

Assorted tidbits and projects

Views » History » Version 6

Version 5 (Christoph Kappel, 01/23/2018 12:24 PM) → Version 6/9 (Christoph Kappel, 02/02/2018 09:01 AM)

h1. Views

{{>toc}}

[[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 are two ways to define a [[Views|view]] in the [[config]]:

h2. Simple

The 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 class="ruby">view "view", "tag"</code></pre>

h2. Extended

Like [[Tagging|tags]], [[Views|views]] can have additionally properties to set a different mode or even add an icon.

<pre><code class="ruby">
view "view" do
match "xterm|[u]?rxvt"
gravity :center
end
</code></pre>

h2. Default

The +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 properties exist:

h3. Icon

This property add an icon to the [[Views|view]] name in the [[Panel|panel]].

Example:

<pre><code class="ruby">view "terms" do
match "urxvt"
icon "/usr/share/icons/icon.xbm"
end</code></pre>

{{subforge_info(You {{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 property hides the [[Views|view]] name from the [[Panel|panel]] when an icon is used.

Example:

<pre><code class="ruby">view "terms" do
icon "/usr/share/icons/icon.xbm"
set :icon_only icon_only true
end</code></pre>

h3. Dynamic

This property hides [[Views|views]] that aren't occupied by [[Clients|clients]] from the panel.

Example:

<pre><code class="ruby">view "terms" do
set :dynamic dynamic true
end</code></pre>

{{subforge_warn([[subtle]] {{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 property works like the [[Tagging#Simple|simple tag matching]], but matches [[Tagging|tag names]] *instead* of actual [[Clients|client]] properties.

<pre><code class="ruby">view "terms" do
match "urxvt"
end</code></pre>