Project

General

Profile

unexist.dev

Assorted tidbits and projects

Views » History » Version 7

Christoph Kappel, 02/02/2018 10:13 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 7 Christoph Kappel
h2. Options
31 5 Christoph Kappel
32 7 Christoph Kappel
Following options exist:
33 1
34 7 Christoph Kappel
h3. Set
35 7 Christoph Kappel
36 7 Christoph Kappel
Set various [[Views#Modes|modes] for [[views]]. Multiple modes can be set separated by comma.
37 7 Christoph Kappel
38 7 Christoph Kappel
<pre><code class="ruby">
39 7 Christoph Kappel
view "modes" do
40 7 Christoph Kappel
  match "xterm"
41 7 Christoph Kappel
  set   :dynamic, :icons_only
42 7 Christoph Kappel
end
43 7 Christoph Kappel
</code></pre>
44 7 Christoph Kappel
45 5 Christoph Kappel
h3. Icon
46 5 Christoph Kappel
47 5 Christoph Kappel
This property add an icon to the [[Views|view]] name in the [[Panel|panel]].
48 5 Christoph Kappel
49 5 Christoph Kappel
Example:
50 6 Christoph Kappel
51 5 Christoph Kappel
<pre><code class="ruby">view "terms" do
52 5 Christoph Kappel
  match "urxvt"
53 5 Christoph Kappel
  icon  "/usr/share/icons/icon.xbm"
54 5 Christoph Kappel
end</code></pre>
55 1
56 1
{{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.)}}
57 5 Christoph Kappel
58 7 Christoph Kappel
h3. Match
59 1
60 7 Christoph Kappel
This property works like the [[Tagging#Simple|simple tag matching]], but matches [[Tagging|tag names]] *instead* of actual [[Clients|client]] properties.
61 1
62 6 Christoph Kappel
<pre><code class="ruby">view "terms" do
63 7 Christoph Kappel
  match   "urxvt"
64 5 Christoph Kappel
end</code></pre>
65 5 Christoph Kappel
66 7 Christoph Kappel
h2. Modes
67 7 Christoph Kappel
68 7 Christoph Kappel
Following modes exist:
69 7 Christoph Kappel
70 1
h3. Dynamic
71 1
72 7 Christoph Kappel
Enable dynamic mode for [[views]]. When set, icons of unoccupied [[views]] ([[views]] that display no windows) are hidden.
73 5 Christoph Kappel
74 1
Example:
75 1
76 1
<pre><code class="ruby">view "terms" do
77 1
  set :dynamic
78 5 Christoph Kappel
end</code></pre>
79 6 Christoph Kappel
80 7 Christoph Kappel
{{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.)}}
81 5 Christoph Kappel
82 7 Christoph Kappel
h3. Icon_only
83 5 Christoph Kappel
84 7 Christoph Kappel
Enable icon only mode. When set, [[subtle]] hides the [[views|view]] name from the [[views|view]] buttons, just the icon will be visible.
85 5 Christoph Kappel
86 7 Christoph Kappel
Example:
87 7 Christoph Kappel
88 5 Christoph Kappel
<pre><code class="ruby">view "terms" do
89 7 Christoph Kappel
  icon "/usr/share/icons/icon.xbm"
90 7 Christoph Kappel
  set  :icon_only
91 1
end</code></pre>