Project

General

Profile

unexist.dev

Assorted tidbits and projects

Views » History » Version 6

Christoph Kappel, 02/02/2018 09:01 AM

1 5 Christoph Kappel
h1. Views
2 5 Christoph Kappel
3 5 Christoph Kappel
{{>toc}}
4 5 Christoph Kappel
5 5 Christoph Kappel
[[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]].
6 5 Christoph Kappel
7 5 Christoph Kappel
There are two ways to define a [[Views|view]] in the [[config]]:
8 5 Christoph Kappel
9 5 Christoph Kappel
h2. Simple
10 5 Christoph Kappel
11 5 Christoph Kappel
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]]:
12 5 Christoph Kappel
13 5 Christoph Kappel
<pre><code class="ruby">view "view", "tag"</code></pre>
14 5 Christoph Kappel
15 5 Christoph Kappel
h2. Extended
16 5 Christoph Kappel
17 5 Christoph Kappel
Like [[Tagging|tags]], [[Views|views]] can have additionally properties to set a different mode or even add an icon.
18 5 Christoph Kappel
19 5 Christoph Kappel
<pre><code class="ruby">
20 5 Christoph Kappel
view "view" do
21 5 Christoph Kappel
  match   "xterm|[u]?rxvt"
22 5 Christoph Kappel
  gravity :center
23 5 Christoph Kappel
end
24 5 Christoph Kappel
</code></pre>
25 5 Christoph Kappel
26 5 Christoph Kappel
h2. Default
27 5 Christoph Kappel
28 5 Christoph Kappel
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*.
29 5 Christoph Kappel
30 5 Christoph Kappel
h2. Properties
31 5 Christoph Kappel
32 5 Christoph Kappel
Following properties exist:
33 5 Christoph Kappel
34 5 Christoph Kappel
h3. Icon
35 5 Christoph Kappel
36 5 Christoph Kappel
This property add an icon to the [[Views|view]] name in the [[Panel|panel]].
37 5 Christoph Kappel
38 5 Christoph Kappel
Example:
39 5 Christoph Kappel
40 5 Christoph Kappel
<pre><code class="ruby">view "terms" do
41 5 Christoph Kappel
  match "urxvt"
42 5 Christoph Kappel
  icon  "/usr/share/icons/icon.xbm"
43 5 Christoph Kappel
end</code></pre>
44 5 Christoph Kappel
45 6 Christoph Kappel
{{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.)}}
46 5 Christoph Kappel
47 5 Christoph Kappel
h3. Icon_only
48 5 Christoph Kappel
49 5 Christoph Kappel
This property hides the [[Views|view]] name from the [[Panel|panel]] when an icon is used.
50 5 Christoph Kappel
51 5 Christoph Kappel
Example:
52 5 Christoph Kappel
53 5 Christoph Kappel
<pre><code class="ruby">view "terms" do
54 6 Christoph Kappel
  icon "/usr/share/icons/icon.xbm"
55 6 Christoph Kappel
  set  :icon_only
56 5 Christoph Kappel
end</code></pre>
57 5 Christoph Kappel
58 5 Christoph Kappel
h3. Dynamic
59 5 Christoph Kappel
60 5 Christoph Kappel
This property hides [[Views|views]] that aren't occupied by [[Clients|clients]] from the panel.
61 5 Christoph Kappel
62 5 Christoph Kappel
Example:
63 5 Christoph Kappel
64 5 Christoph Kappel
<pre><code class="ruby">view "terms" do
65 6 Christoph Kappel
  set :dynamic
66 5 Christoph Kappel
end</code></pre>
67 5 Christoph Kappel
68 6 Christoph Kappel
{{subforge_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.)}}
69 5 Christoph Kappel
70 5 Christoph Kappel
h3. Match
71 5 Christoph Kappel
72 5 Christoph Kappel
This property works like the [[Tagging#Simple|simple tag matching]], but matches [[Tagging|tag names]] *instead* of actual [[Clients|client]] properties.
73 5 Christoph Kappel
74 5 Christoph Kappel
<pre><code class="ruby">view "terms" do
75 5 Christoph Kappel
  match   "urxvt"
76 5 Christoph Kappel
end</code></pre>