Views » History » Version 8
Christoph Kappel, 02/02/2018 10:22 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 | 8 | 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.)}} |
45 | 8 | Christoph Kappel | |
46 | 8 | Christoph Kappel | h3. Icon_only |
47 | 8 | Christoph Kappel | |
48 | 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. |
49 | 8 | Christoph Kappel | |
50 | 8 | Christoph Kappel | Example: |
51 | 8 | Christoph Kappel | |
52 | 8 | Christoph Kappel | <pre><code class="ruby">view "terms" do |
53 | 8 | Christoph Kappel | icon "/usr/share/icons/icon.xbm" |
54 | 8 | Christoph Kappel | set :icon_only |
55 | 8 | Christoph Kappel | end</code></pre> |
56 | 8 | Christoph Kappel | |
57 | 7 | Christoph Kappel | h2. Options |
58 | 5 | Christoph Kappel | |
59 | 7 | Christoph Kappel | Following options exist: |
60 | 1 | ||
61 | 7 | Christoph Kappel | h3. Set |
62 | 7 | Christoph Kappel | |
63 | 7 | Christoph Kappel | Set various [[Views#Modes|modes] for [[views]]. Multiple modes can be set separated by comma. |
64 | 5 | Christoph Kappel | |
65 | 5 | Christoph Kappel | <pre><code class="ruby"> |
66 | 7 | Christoph Kappel | view "modes" do |
67 | 7 | Christoph Kappel | match "xterm" |
68 | 7 | Christoph Kappel | set :dynamic, :icons_only |
69 | 7 | Christoph Kappel | end |
70 | 1 | </code></pre> |
|
71 | 1 | ||
72 | 7 | Christoph Kappel | h3. Icon |
73 | 5 | Christoph Kappel | |
74 | 1 | This property add an icon to the [[Views|view]] name in the [[Panel|panel]]. |
|
75 | 1 | ||
76 | 1 | Example: |
|
77 | 1 | ||
78 | 5 | Christoph Kappel | <pre><code class="ruby">view "terms" do |
79 | 6 | Christoph Kappel | match "urxvt" |
80 | 7 | Christoph Kappel | icon "/usr/share/icons/icon.xbm" |
81 | 5 | Christoph Kappel | end</code></pre> |
82 | 7 | Christoph Kappel | |
83 | 5 | 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.)}} |
84 | 7 | Christoph Kappel | |
85 | 5 | Christoph Kappel | h3. Match |
86 | 7 | Christoph Kappel | |
87 | 7 | Christoph Kappel | This property works like the [[Tagging#Simple|simple tag matching]], but matches [[Tagging|tag names]] *instead* of actual [[Clients|client]] properties. |
88 | 5 | Christoph Kappel | |
89 | 7 | Christoph Kappel | <pre><code class="ruby">view "terms" do |
90 | 7 | Christoph Kappel | match "urxvt" |
91 | 1 | end</code></pre> |