Project

General

Profile

unexist.dev

/

subtle

Assorted tidbits and projects

Views » History » Version 8

Version 7 (Christoph Kappel, 02/02/2018 10:13 AM) → Version 8/9 (Christoph Kappel, 02/02/2018 10:22 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. Modes

Following modes exist:

h3. Dynamic

Enable dynamic mode for [[views]]. When set, icons of unoccupied [[views]] ([[views]] that display no windows) are hidden.

Example:

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

{{subforge_warn([[subtle]] *doesn't* change the numbering of the [[Views|views]] yet, that means when there are three [[Views|views]] and the second is [[Views#Dynamic|dynamic]] the third is *still* the third.)}}

h3. Icon_only

Enable icon only mode. When set, [[subtle]] hides the [[views|view]] name from the [[views|view]] buttons, just the icon will be visible.

Example:

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

h2.
Options

Following options exist:

h3. Set

Set various [[Views#Modes|modes] for [[views]]. Multiple modes can be set separated by comma.

<pre><code class="ruby">
view "modes" do
match "xterm"
set :dynamic, :icons_only
end
</code></pre>

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 can also pass a "Subtlext::Icon":http://rdoc.subforge.org/subtle/classes/Subtlext/Icon.html object to *icon* _instead_ of a path.)}}

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>



h2. Modes

Following modes exist:

h3. Dynamic

Enable dynamic mode for [[views]]. When set, icons of unoccupied [[views]] ([[views]] that display no windows) are hidden.

Example:

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

{{subforge_warn([[subtle]] *doesn't* change the numbering of the [[Views|views]] yet, that means when there are three [[Views|views]] and the second is [[Views#Dynamic|dynamic]] the third is *still* the third.)}}

h3. Icon_only

Enable icon only mode. When set, [[subtle]] hides the [[views|view]] name from the [[views|view]] buttons, just the icon will be visible.

Example:

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