Project

General

Profile

unexist.dev

/

subtle

Assorted tidbits and projects

Views » History » Version 9

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