Project

General

Profile

unexist.dev

subtle

Assorted tidbits and projects

FAQ » History » Version 3

Christoph Kappel, 01/23/2018 02:22 PM

1 1 Christoph Kappel
h1. FAQ
2 1 Christoph Kappel
3 1 Christoph Kappel
{{toc}}
4 1 Christoph Kappel
5 3 Christoph Kappel
h2.  How do I start program xyz?
6 1 Christoph Kappel
7 3 Christoph Kappel
There are several way how to start a certain programm, here are the most common:
8 3 Christoph Kappel
9 3 Christoph Kappel
* Start your program via your $HOME/.xinitrc:
10 3 Christoph Kappel
11 3 Christoph Kappel
<pre><code class="ruby">
12 3 Christoph Kappel
subtle &
13 3 Christoph Kappel
PID=$!
14 3 Christoph Kappel
sleep 2
15 3 Christoph Kappel
urxvt
16 3 Christoph Kappel
wait $PID
17 3 Christoph Kappel
</code></pre>
18 3 Christoph Kappel
19 3 Christoph Kappel
* Start your program via [[grab]]:
20 3 Christoph Kappel
21 3 Christoph Kappel
<pre><code class="ruby">
22 3 Christoph Kappel
"A-x" => "urxvt"
23 3 Christoph Kappel
</code></pre>
24 3 Christoph Kappel
25 3 Christoph Kappel
_"dmenu":http://tools.suckless.org/dmenu is added as default launcher in the distributed config to make it more convenient._
26 3 Christoph Kappel
27 3 Christoph Kappel
h2.  How do I move program xyz to view abc?
28 3 Christoph Kappel
29 3 Christoph Kappel
Placement in [[subtle]] is +strict+ and completely done via the [[Tags|tagging system]] and is initially usually done in the [[config]].
30 3 Christoph Kappel
31 3 Christoph Kappel
You can change tags either with [[subtler]] or [[subtlext]] per runtime:
32 3 Christoph Kappel
33 3 Christoph Kappel
[[Subtler]]:
34 3 Christoph Kappel
<pre><code class="ruby">
35 3 Christoph Kappel
subtler -ta tag         #< Add new tag 'tag'
36 3 Christoph Kappel
subtler -cT view tag    #< Tag view 'view' with tag 'tag'
37 3 Christoph Kappel
subtler -vT client tag  #< Tag client 'client' with tag 'tag'
38 3 Christoph Kappel
</code></pre>
39 3 Christoph Kappel
40 3 Christoph Kappel
[[Subtlext]]:
41 3 Christoph Kappel
<pre><code class="ruby">
42 3 Christoph Kappel
s = Subtlext::Subtle.new            #< Connect to subtle
43 3 Christoph Kappel
s.find_client("client").tag("tag")  #< Tag client 'client' with tag 'tag'
44 3 Christoph Kappel
s.find_view("view").tag("tag")      #< Tag view 'view' with tag 'tag'
45 3 Christoph Kappel
</code></pre>
46 3 Christoph Kappel
47 3 Christoph Kappel
In _/usr/share/subtle/scripts_ is a tagging example script with the help of "dmenu":http://tools.suckless.org/dmenu.
48 3 Christoph Kappel
49 3 Christoph Kappel
h2.  How do I move program xyz to view abc?
50 3 Christoph Kappel
51 3 Christoph Kappel
Placement in [[subtle]] is +strict+ and completely done via the [[Tags|tagging system]] and is initially usually done in the [[config]].
52 3 Christoph Kappel
53 3 Christoph Kappel
You can change tags either with [[subtler]] or [[subtlext]] per runtime:
54 3 Christoph Kappel
55 3 Christoph Kappel
[[Subtler]]:
56 3 Christoph Kappel
<pre><code class="ruby">
57 3 Christoph Kappel
subtler -ta tag           #< Add new tag 'tag'
58 3 Christoph Kappel
subtler -cT client tag  #< Tag client 'client' with tag 'tag'
59 3 Christoph Kappel
subtler -vT view tag   #< Tag view 'view' with tag 'tag'
60 3 Christoph Kappel
</code></pre>
61 3 Christoph Kappel
62 3 Christoph Kappel
[[Subtlext]]:
63 3 Christoph Kappel
<pre><code class="ruby">
64 3 Christoph Kappel
s = Subtlext::Subtle.new            #< Connect to subtle
65 3 Christoph Kappel
s.find_client("client").tag("tag")  #< Tag client 'client' with tag 'tag'
66 3 Christoph Kappel
s.find_view("view").tag("tag")    #< Tag view 'view' with tag 'tag'
67 3 Christoph Kappel
</code></pre>
68 3 Christoph Kappel
69 3 Christoph Kappel
In _/usr/share/subtle/scripts_ is a tagging example script with the help of "dmenu":http://tools.suckless.org/dmenu.
70 3 Christoph Kappel
71 3 Christoph Kappel
h2.  How do I move program xyz to view abc?
72 3 Christoph Kappel
73 3 Christoph Kappel
Placement in [[subtle]] is +strict+ and completely done via the [[Tags|tagging system]] and is initially usually done in the [[config]].
74 3 Christoph Kappel
75 3 Christoph Kappel
You can change tags either with [[subtler]] or [[subtlext]] per runtime:
76 3 Christoph Kappel
77 3 Christoph Kappel
[[Subtler]]:
78 3 Christoph Kappel
<pre><code class="ruby">
79 3 Christoph Kappel
subtler -ta tag         #< Add new tag 'tag'
80 3 Christoph Kappel
subtler -cT client tag  #< Tag client 'client' with tag 'tag'
81 3 Christoph Kappel
subtler -vT view tag    #< Tag view 'view' with tag 'tag'
82 3 Christoph Kappel
</code></pre>
83 3 Christoph Kappel
84 3 Christoph Kappel
[[Subtlext]]:
85 3 Christoph Kappel
<pre><code class="ruby">
86 3 Christoph Kappel
s = Subtlext::Subtle.new            #< Connect to subtle
87 3 Christoph Kappel
s.find_client("client").tag("tag")  #< Tag client 'client' with tag 'tag'
88 3 Christoph Kappel
s.find_view("view").tag("tag")      #< Tag view 'view' with tag 'tag'
89 3 Christoph Kappel
</code></pre>
90 3 Christoph Kappel
91 3 Christoph Kappel
In _/usr/share/subtle/scripts_ is a tagging example script with the help of "dmenu":http://tools.suckless.org/dmenu.
92 3 Christoph Kappel
93 3 Christoph Kappel
h2.  How does subtle match clients?
94 3 Christoph Kappel
95 1 Christoph Kappel
[[Subtle]] matches the {{color(#ff0000, WM_NAME)}} and the {{color(#0000ff, WM_CLASS)}} property of a window and not the title. This to ensure the match is correct. 
96 2 Christoph Kappel
There are several ways to get these values, here are the most common:
97 1 Christoph Kappel
98 2 Christoph Kappel
* "xprop":http://www.xfree86.org/current/xprop.1.html: Just select the window and have a look for the WM_CLASS line which usually look like this:
99 1 Christoph Kappel
100 2 Christoph Kappel
p{class:pre}. WM_CLASS(STRING) = "{{color(#ff0000, urxvt)}}", "{{color(#0000ff, URxvt)}}")
101 1 Christoph Kappel
102 2 Christoph Kappel
* [[subtler]]: Run *[[subtler]] -cl* and look for the matching line:
103 1 Christoph Kappel
104 1 Christoph Kappel
p{class:pre}. 0x800007 * 1 1020x374 2 1 --- {{color(#ff0000, urxvt)}} ({{color(#0000ff,URxvt)}})
105 2 Christoph Kappel
106 3 Christoph Kappel
h2.  How do I move program xyz to view abc?
107 3 Christoph Kappel
108 1 Christoph Kappel
Placement in [[subtle]] is +strict+ and completely done via the [[Tags|tagging system]] and is initially usually done in the [[config]].
109 2 Christoph Kappel
110 2 Christoph Kappel
You can change tags either with [[subtler]] or [[subtlext]] per runtime:
111 2 Christoph Kappel
112 2 Christoph Kappel
[[Subtler]]:
113 2 Christoph Kappel
<pre><code class="ruby">
114 2 Christoph Kappel
subtler -ta tag         #< Add new tag 'tag'
115 2 Christoph Kappel
subtler -cT client tag  #< Tag client 'client' with tag 'tag'
116 2 Christoph Kappel
subtler -vT view tag    #< Tag view 'view' with tag 'tag'
117 2 Christoph Kappel
</code></pre>
118 2 Christoph Kappel
119 2 Christoph Kappel
[[Subtlext]]:
120 2 Christoph Kappel
<pre><code class="ruby">
121 2 Christoph Kappel
s = Subtlext::Subtle.new            #< Connect to subtle
122 2 Christoph Kappel
s.find_client("client").tag("tag")  #< Tag client 'client' with tag 'tag'
123 2 Christoph Kappel
s.find_view("view").tag("tag")      #< Tag view 'view' with tag 'tag'
124 2 Christoph Kappel
</code></pre>
125 2 Christoph Kappel
126 2 Christoph Kappel
[[Grabs]]:
127 2 Christoph Kappel
<pre><code class="ruby">
128 2 Christoph Kappel
def move_view(client, view_id)
129 2 Christoph Kappel
  begin
130 2 Christoph Kappel
    cur  = current_view
131 2 Christoph Kappel
    view = views[view_id - 1]
132 2 Christoph Kappel
133 2 Christoph Kappel
    begin
134 2 Christoph Kappel
      tag = find_tag(view.name)
135 2 Christoph Kappel
    rescue
136 2 Christoph Kappel
      tag = add_tag(view.name)
137 2 Christoph Kappel
    end
138 2 Christoph Kappel
139 2 Christoph Kappel
    # Remove client from current tag
140 2 Christoph Kappel
    if(client.has_tag?(cur.name))
141 2 Christoph Kappel
      client.untag(cur.name)
142 2 Christoph Kappel
    end
143 2 Christoph Kappel
  
144 2 Christoph Kappel
    # Tag new view with itself
145 2 Christoph Kappel
    if(!view.has_tag?(tag))
146 2 Christoph Kappel
      view.tag(tag)
147 2 Christoph Kappel
    end
148 2 Christoph Kappel
149 2 Christoph Kappel
    # Finally add tag to client
150 2 Christoph Kappel
    client.tag(tag)
151 2 Christoph Kappel
  rescue => err
152 2 Christoph Kappel
    puts err
153 2 Christoph Kappel
  end
154 2 Christoph Kappel
end
155 2 Christoph Kappel
156 2 Christoph Kappel
GRABS = {
157 2 Christoph Kappel
  "A-F1" => lambda { |c| move_view(c, 1) },
158 2 Christoph Kappel
  "A-F2" => lambda { |c| move_view(c, 2) },
159 2 Christoph Kappel
  "A-F3" => lambda { |c| move_view(c, 3) },
160 2 Christoph Kappel
  "A-F4" => lambda { |c| move_view(c, 4) }
161 2 Christoph Kappel
}
162 1 Christoph Kappel
</code></pre>
163 1 Christoph Kappel
164 2 Christoph Kappel
In _/usr/share/subtle/scripts_ is a tagging example script with the help of "dmenu":http://tools.suckless.org/dmenu.
165 1 Christoph Kappel
166 3 Christoph Kappel
h2.  How do I move program xyz to view abc?
167 3 Christoph Kappel
168 2 Christoph Kappel
Placement in [[subtle]] is +strict+ and completely done via the [[Tags|tagging system]] and is initially usually done in the [[config]].
169 2 Christoph Kappel
170 2 Christoph Kappel
You can change tags either with [[subtler]] or [[subtlext]] per runtime:
171 2 Christoph Kappel
172 2 Christoph Kappel
[[Subtler]]:
173 2 Christoph Kappel
<pre><code class="ruby">
174 2 Christoph Kappel
subtler -ta tag         #< Add new tag 'tag'
175 2 Christoph Kappel
subtler -cT client tag  #< Tag client 'client' with tag 'tag'
176 2 Christoph Kappel
subtler -vT view tag    #< Tag view 'view' with tag 'tag'
177 2 Christoph Kappel
</code></pre>
178 2 Christoph Kappel
179 2 Christoph Kappel
[[Subtlext]]:
180 2 Christoph Kappel
<pre><code class="ruby">
181 2 Christoph Kappel
s = Subtlext::Subtle.new            #< Connect to subtle
182 2 Christoph Kappel
s.find_client("client").tag("tag")  #< Tag client 'client' with tag 'tag'
183 2 Christoph Kappel
s.find_view("view").tag("tag")      #< Tag view 'view' with tag 'tag'
184 2 Christoph Kappel
</code></pre>
185 2 Christoph Kappel
186 2 Christoph Kappel
Or with [[grabs]] and "Ruby":http://www.ruby-lang.org lambdas:
187 2 Christoph Kappel
188 2 Christoph Kappel
[[Grabs]]:
189 2 Christoph Kappel
<pre><code class="ruby">
190 2 Christoph Kappel
def move_view(client, view_id)
191 2 Christoph Kappel
  begin
192 2 Christoph Kappel
    cur  = current_view
193 2 Christoph Kappel
    view = views[view_id - 1]
194 2 Christoph Kappel
195 2 Christoph Kappel
    begin
196 2 Christoph Kappel
      tag = find_tag(view.name)
197 2 Christoph Kappel
    rescue
198 2 Christoph Kappel
      tag = add_tag(view.name)
199 2 Christoph Kappel
    end
200 2 Christoph Kappel
201 2 Christoph Kappel
    # Remove client from current tag
202 2 Christoph Kappel
    if(client.has_tag?(cur.name))
203 2 Christoph Kappel
      client.untag(cur.name)
204 2 Christoph Kappel
    end
205 2 Christoph Kappel
  
206 2 Christoph Kappel
    # Tag new view with itself
207 2 Christoph Kappel
    if(!view.has_tag?(tag))
208 2 Christoph Kappel
      view.tag(tag)
209 2 Christoph Kappel
    end
210 2 Christoph Kappel
211 2 Christoph Kappel
    # Finally add tag to client
212 2 Christoph Kappel
    client.tag(tag)
213 2 Christoph Kappel
  rescue => err
214 2 Christoph Kappel
    puts err
215 2 Christoph Kappel
  end
216 2 Christoph Kappel
end
217 2 Christoph Kappel
218 2 Christoph Kappel
GRABS = {
219 2 Christoph Kappel
  "A-F1" => lambda { |c| move_view(c, 1) },
220 2 Christoph Kappel
  "A-F2" => lambda { |c| move_view(c, 2) },
221 2 Christoph Kappel
  "A-F3" => lambda { |c| move_view(c, 3) },
222 1 Christoph Kappel
  "A-F4" => lambda { |c| move_view(c, 4) }
223 1 Christoph Kappel
}
224 1 Christoph Kappel
</code></pre>
225 2 Christoph Kappel
226 1 Christoph Kappel
In _/usr/share/subtle/scripts_ is a tagging example script with the help of "dmenu":http://tools.suckless.org/dmenu.
227 2 Christoph Kappel
228 3 Christoph Kappel
h2.  How do I move program xyz to view abc?
229 3 Christoph Kappel
230 2 Christoph Kappel
Placement in [[subtle]] is +strict+ and completely done via the [[Tags|tagging system]] and is initially usually done in the [[config]].
231 2 Christoph Kappel
232 2 Christoph Kappel
You can change tags either with [[subtler]] or [[subtlext]] per runtime:
233 2 Christoph Kappel
234 2 Christoph Kappel
[[Subtler]]:
235 2 Christoph Kappel
<pre><code class="ruby">
236 2 Christoph Kappel
subtler -ta tag         #< Add new tag 'tag'
237 2 Christoph Kappel
subtler -cT client tag  #< Tag client 'client' with tag 'tag'
238 2 Christoph Kappel
subtler -vT view tag    #< Tag view 'view' with tag 'tag'
239 2 Christoph Kappel
</code></pre>
240 2 Christoph Kappel
241 2 Christoph Kappel
[[Subtlext]]:
242 2 Christoph Kappel
<pre><code class="ruby">
243 2 Christoph Kappel
s = Subtlext::Subtle.new            #< Connect to subtle
244 2 Christoph Kappel
s.find_client("client").tag("tag")  #< Tag client 'client' with tag 'tag'
245 2 Christoph Kappel
s.find_view("view").tag("tag")      #< Tag view 'view' with tag 'tag'
246 1 Christoph Kappel
</code></pre>
247 1 Christoph Kappel
248 1 Christoph Kappel
Please also have a look at the [[recipes]] wiki page which also includes two examples how to move clients.
249 2 Christoph Kappel
250 1 Christoph Kappel
In _/usr/share/subtle/scripts_ is a tagging example script with the help of "dmenu":http://tools.suckless.org/dmenu.
251 2 Christoph Kappel
252 3 Christoph Kappel
h2.  How do I set a wallpaper in subtle?
253 3 Christoph Kappel
254 2 Christoph Kappel
[[subtle]] itself has no own functionality to set a wallpaper, _~/.xinitrc_ is perfectly suited for this. 
255 2 Christoph Kappel
256 2 Christoph Kappel
Due the design of [[subtle]] sets background color of the root window and therefore overwrites any root pixmap set before. 
257 2 Christoph Kappel
258 2 Christoph Kappel
This can be bypassed with this:
259 1 Christoph Kappel
260 1 Christoph Kappel
<pre><code class="ruby">subtle &
261 2 Christoph Kappel
PID=$!
262 1 Christoph Kappel
display -window root pixmap.png
263 2 Christoph Kappel
wait $PID
264 1 Christoph Kappel
</code></pre>
265 2 Christoph Kappel
266 3 Christoph Kappel
h2.  How do I set a wallpaper in subtle?
267 3 Christoph Kappel
268 2 Christoph Kappel
[[subtle]] itself has no own functionality to set a wallpaper, _~/.xinitrc_ is perfectly suited for this. 
269 2 Christoph Kappel
270 2 Christoph Kappel
Due the design of [[subtle]] sets background color of the root window and therefore overwrites any root pixmap set before. 
271 2 Christoph Kappel
272 2 Christoph Kappel
This can be bypassed with this:
273 2 Christoph Kappel
274 1 Christoph Kappel
<pre><code class="ruby">subtle &
275 1 Christoph Kappel
PID=$!
276 2 Christoph Kappel
display -window root pixmap.png
277 2 Christoph Kappel
wait $PID
278 1 Christoph Kappel
</code></pre>
279 2 Christoph Kappel
280 1 Christoph Kappel
Or just comment out the background line.
281 2 Christoph Kappel
282 3 Christoph Kappel
h2.  How do I run a java program?
283 3 Christoph Kappel
284 2 Christoph Kappel
"Java":http://java.com *expects* a certain behaviour (_reparenting of client windows_) of a window manager which is not part of any standard, therefore some "Java":http://java.com programs just show a white canvas.
285 2 Christoph Kappel
286 2 Christoph Kappel
If this happens just try to start your program like this:
287 2 Christoph Kappel
288 2 Christoph Kappel
<pre><code class="shell">AWT_TOOLKIT=MToolkit program</code></pre>
289 2 Christoph Kappel
290 2 Christoph Kappel
This changes the default tookit of "Java":http://java.com to MToolkit, which is known to work with non-reparenting windows managers like [[subtle]]. Dependend on your "OpenJDK":http://openjdk.java.net version and your architecture this may either lead to a segmentation fault or your "OpenJDK":http://openjdk.java.net just has no support for *MToolkit*. In this case check if your distribution has applied a patch for this issue which allows something like this to change the default behaviour:
291 2 Christoph Kappel
292 1 Christoph Kappel
<pre><code class="shell">_JAVA_AWT_WM_NONREPARENTING=1 program</code></pre>
293 1 Christoph Kappel
294 2 Christoph Kappel
Generally this problem is really long lasting, see here: 
295 2 Christoph Kappel
296 2 Christoph Kappel
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6511454
297 1 Christoph Kappel
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=508650
298 2 Christoph Kappel
299 1 Christoph Kappel
300 2 Christoph Kappel
301 3 Christoph Kappel
h2.  How do I move program xyz to view abc?
302 3 Christoph Kappel
303 2 Christoph Kappel
Placement in [[subtle]] is +strict+ and completely done via the [[Tags|tagging system]] and is initially usually done in the [[config]].
304 2 Christoph Kappel
305 2 Christoph Kappel
You can change tags either with [[subtler]] or [[subtlext]] per runtime:
306 2 Christoph Kappel
307 2 Christoph Kappel
[[Subtler]]:
308 2 Christoph Kappel
<pre><code class="ruby">
309 2 Christoph Kappel
subtler -ta tag         #< Add new tag 'tag'
310 2 Christoph Kappel
subtler -cT client tag  #< Tag client 'client' with tag 'tag'
311 2 Christoph Kappel
subtler -vT view tag    #< Tag view 'view' with tag 'tag'
312 2 Christoph Kappel
</code></pre>
313 2 Christoph Kappel
314 2 Christoph Kappel
[[Subtlext]]:
315 1 Christoph Kappel
<pre><code class="ruby">
316 1 Christoph Kappel
s = Subtlext::Subtle.new            #< Connect to subtle
317 2 Christoph Kappel
s.find_client("client").tag("tag")  #< Tag client 'client' with tag 'tag'
318 2 Christoph Kappel
s.find_view("view").tag("tag")      #< Tag view 'view' with tag 'tag'
319 2 Christoph Kappel
</code></pre>
320 2 Christoph Kappel
321 1 Christoph Kappel
Please also have a look at the [[recipes]] wiki page which also includes two examples how to move clients.
322 2 Christoph Kappel
323 1 Christoph Kappel
In _/usr/share/subtle/scripts_ is a tagging example script with the help of "dmenu":http://tools.suckless.org/dmenu.
324 2 Christoph Kappel
325 3 Christoph Kappel
h2.  How do I start program xyz?
326 3 Christoph Kappel
327 2 Christoph Kappel
There are several way how to start a certain programm, here are the most common:
328 2 Christoph Kappel
329 2 Christoph Kappel
* Start your program via your $HOME/.xinitrc:
330 2 Christoph Kappel
331 2 Christoph Kappel
<pre><code class="ruby">
332 2 Christoph Kappel
subtle &
333 2 Christoph Kappel
PID=$!
334 2 Christoph Kappel
sleep 2
335 2 Christoph Kappel
urxvt
336 1 Christoph Kappel
wait $PID
337 1 Christoph Kappel
</code></pre>
338 2 Christoph Kappel
339 2 Christoph Kappel
* Start your program via [[grab]]:
340 2 Christoph Kappel
341 2 Christoph Kappel
<pre><code class="ruby">
342 2 Christoph Kappel
"A-x" => "urxvt"
343 1 Christoph Kappel
</code></pre>
344 2 Christoph Kappel
345 1 Christoph Kappel
_"dmenu":http://tools.suckless.org/dmenu is added as default launcher in the distributed config to make it more convenient._
346 2 Christoph Kappel
347 3 Christoph Kappel
h2.  How do I run a java program?
348 3 Christoph Kappel
349 2 Christoph Kappel
"Java":http://java.com *expects* a certain behaviour (_reparenting of client windows_) of a window manager which is not part of any standard, therefore some "Java":http://java.com programs just show a white canvas.
350 2 Christoph Kappel
351 2 Christoph Kappel
If this happens just try to start your program like this:
352 2 Christoph Kappel
353 2 Christoph Kappel
<pre><code class="shell">AWT_TOOLKIT=MToolkit program</code></pre>
354 1 Christoph Kappel
355 1 Christoph Kappel
This changes the default tookit of "Java":http://java.com to MToolkit, which is known to work with non-reparenting windows managers like [[subtle]]. Dependend on your "OpenJDK":http://openjdk.java.net version and your architecture this may either lead to a segmentation fault or your "OpenJDK":http://openjdk.java.net just has no support for *MToolkit*. In this case check if your distribution has applied a patch for this issue which allows something like this to change the default behaviour:
356 2 Christoph Kappel
357 2 Christoph Kappel
<pre><code class="shell">_JAVA_AWT_WM_NONREPARENTING=1 program</code></pre>
358 2 Christoph Kappel
359 2 Christoph Kappel
Generally this problem is really long lasting, see here: 
360 2 Christoph Kappel
361 2 Christoph Kappel
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6511454
362 2 Christoph Kappel
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=508650
363 1 Christoph Kappel
364 2 Christoph Kappel
365 1 Christoph Kappel
366 3 Christoph Kappel
h2.  How do I run a java program?
367 3 Christoph Kappel
368 2 Christoph Kappel
"Java":http://java.com *expects* a certain behaviour (_reparenting of client windows_) of a window manager which is not part of any standard, therefore some "Java":http://java.com programs just show a white canvas.
369 2 Christoph Kappel
370 2 Christoph Kappel
If this happens just try to start your program like this:
371 2 Christoph Kappel
372 2 Christoph Kappel
<pre><code class="shell">AWT_TOOLKIT=MToolkit program</code></pre>
373 2 Christoph Kappel
374 1 Christoph Kappel
This changes the default tookit of "Java":http://java.com to MToolkit, which is known to work with non-reparenting windows managers like [[subtle]]. Dependend on your "OpenJDK":http://openjdk.java.net version and your architecture this may either lead to a segmentation fault or your "OpenJDK":http://openjdk.java.net just has no support for *MToolkit*. In this case check if your distribution has applied a patch for this issue which allows something like this to change the default behaviour:
375 1 Christoph Kappel
376 2 Christoph Kappel
<pre><code class="shell">_JAVA_AWT_WM_NONREPARENTING=1 program</code></pre>
377 2 Christoph Kappel
378 2 Christoph Kappel
In case both doesn't work there is a third option: The JDK internally uses a hardcoded list of window managers that are non-reparenting, the "suckless":http://suckless.org made the tool "wmname":http://tools.suckless.org/wmname to change the name of the wm and just lie to Java. 
379 2 Christoph Kappel
380 2 Christoph Kappel
Generally this problem is really long lasting, see here: 
381 2 Christoph Kappel
382 2 Christoph Kappel
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6511454
383 2 Christoph Kappel
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=508650
384 1 Christoph Kappel
385 2 Christoph Kappel
386 1 Christoph Kappel
387 3 Christoph Kappel
h2.  How do I run a java program?
388 3 Christoph Kappel
389 2 Christoph Kappel
"Java":http://java.com *expects* a certain behaviour (_reparenting of client windows_) of a window manager which is not part of any standard, therefore some "Java":http://java.com programs just show a white canvas.
390 2 Christoph Kappel
391 2 Christoph Kappel
If this happens just try to start your program like this:
392 2 Christoph Kappel
393 2 Christoph Kappel
<pre><code class="shell">AWT_TOOLKIT=MToolkit program</code></pre>
394 1 Christoph Kappel
395 1 Christoph Kappel
This changes the default tookit of "Java":http://java.com to MToolkit, which is known to work with non-reparenting windows managers like [[subtle]]. Dependend on your "OpenJDK":http://openjdk.java.net version and your architecture this may either lead to a segmentation fault or your "OpenJDK":http://openjdk.java.net just has no support for *MToolkit*. In this case check if your distribution has applied a patch for this issue which allows something like this to change the default behaviour:
396 2 Christoph Kappel
397 2 Christoph Kappel
<pre><code class="shell">_JAVA_AWT_WM_NONREPARENTING=1 program</code></pre>
398 2 Christoph Kappel
399 2 Christoph Kappel
In case both doesn't work there is a third option: The JDK internally uses a hardcoded list of window managers that are non-reparenting, the "suckless":http://suckless.org guys made the tool "wmname":http://tools.suckless.org/wmname to change the name of the wm and just lie to Java. 
400 2 Christoph Kappel
401 2 Christoph Kappel
Generally this problem is really long lasting, see here: 
402 2 Christoph Kappel
403 2 Christoph Kappel
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6511454
404 2 Christoph Kappel
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=508650
405 1 Christoph Kappel
406 2 Christoph Kappel
407 1 Christoph Kappel
408 3 Christoph Kappel
h2.  How do I move program xyz to view abc?
409 3 Christoph Kappel
410 2 Christoph Kappel
Placement in [[subtle]] is +strict+ and completely done via the [[Tags|tagging system]] and is initially usually done in the [[config]].
411 2 Christoph Kappel
412 2 Christoph Kappel
You can change tags either with [[subtler]] or [[subtlext]] per runtime:
413 2 Christoph Kappel
414 2 Christoph Kappel
[[Subtler]]:
415 2 Christoph Kappel
<pre><code class="ruby">
416 2 Christoph Kappel
subtler -ta tag         #< Add new tag 'tag'
417 1 Christoph Kappel
subtler -cT client tag  #< Tag client 'client' with tag 'tag'
418 1 Christoph Kappel
subtler -vT view tag    #< Tag view 'view' with tag 'tag'
419 2 Christoph Kappel
</code></pre>
420 2 Christoph Kappel
421 2 Christoph Kappel
[[Subtlext]]:
422 2 Christoph Kappel
<pre><code class="ruby">
423 2 Christoph Kappel
Subtlext::Tag.new("tag").save       #< Add new tag 'tag'
424 2 Christoph Kappel
Subtlext::Client["client"] + "tag"  #< Tag client 'client' with tag 'tag'
425 2 Christoph Kappel
Subtlext::View["view"] + "tag"      #< Tag view 'view' with tag 'tag'
426 2 Christoph Kappel
</code></pre>
427 2 Christoph Kappel
428 2 Christoph Kappel
Please also have a look at the [[recipes]] wiki page which also includes two examples how to move clients.
429 2 Christoph Kappel
430 1 Christoph Kappel
In _/usr/share/subtle/scripts_ is a tagging example script with the help of "dmenu":http://tools.suckless.org/dmenu.
431 2 Christoph Kappel
432 3 Christoph Kappel
h2.  How do I move program xyz to view abc?
433 3 Christoph Kappel
434 2 Christoph Kappel
Placement in [[subtle]] is +strict+ and completely done via the [[Tags|tagging system]] and is initially usually done in the [[config]].
435 2 Christoph Kappel
436 2 Christoph Kappel
You can change tags either with [[subtler]] or [[subtlext]] per runtime:
437 2 Christoph Kappel
438 2 Christoph Kappel
[[Subtler]]:
439 2 Christoph Kappel
<pre><code class="ruby">
440 1 Christoph Kappel
subtler -ta tag         #< Add new tag 'tag'
441 1 Christoph Kappel
subtler -cT client tag  #< Tag client 'client' with tag 'tag'
442 2 Christoph Kappel
subtler -vT view tag    #< Tag view 'view' with tag 'tag'
443 2 Christoph Kappel
</code></pre>
444 2 Christoph Kappel
445 2 Christoph Kappel
[[Subtlext]]:
446 2 Christoph Kappel
<pre><code class="ruby">
447 2 Christoph Kappel
Subtlext::Tag.new("tag").save       #< Add new tag 'tag'
448 2 Christoph Kappel
Subtlext::Client["client"] + "tag"  #< Tag client 'client' with tag 'tag'
449 2 Christoph Kappel
Subtlext::View["view"] + "tag"      #< Tag view 'view' with tag 'tag'
450 2 Christoph Kappel
</code></pre>
451 2 Christoph Kappel
452 1 Christoph Kappel
Please also have a look at the [[recipes]] wiki page which also includes two examples how to move clients.
453 2 Christoph Kappel
454 1 Christoph Kappel
In _/usr/share/subtle/scripts_ is a tagging example script with the help of "dmenu":http://tools.suckless.org/dmenu.
455 2 Christoph Kappel
456 3 Christoph Kappel
h2.  How do I add tags to console based programs?
457 3 Christoph Kappel
458 2 Christoph Kappel
Generally [[subtle]] can apply [[Tagging|tags]] based on the {{color(#0000ff, WM_NAME)}} and both {{color(#ff0000, WM_CLASS)}} components. Console based programs like "irssi":http://irssi.org can be started like this and will change the {{color(#0000ff, WM_NAME)}} of the terminal:
459 2 Christoph Kappel
460 2 Christoph Kappel
<pre><code class="bash">urxvt -e irssi</code></pre>
461 2 Christoph Kappel
462 2 Christoph Kappel
Inspecting the terminal with "xprop":http://www.xfree86.org/current/xprop.1.html:
463 2 Christoph Kappel
464 2 Christoph Kappel
<pre><code class="bash">{{color(#0000ff, WM_NAME)}}(STRING) = "irssi"
465 2 Christoph Kappel
{{color(#ff0000, WM_CLASS)}}(STRING) = {{color(#aa0000, "urxvt")}}, {{color(#ff00ff, "URxvt")}}</code></pre>
466 2 Christoph Kappel
467 2 Christoph Kappel
So if we want to tag this window there are some things that should be considered:
468 2 Christoph Kappel
469 2 Christoph Kappel
* "irssi":http://irssi.org updates the {{color(#0000ff, WM_NAME)}} only
470 2 Christoph Kappel
* [[Tagging]] matches per default both {{color(#ff0000, WM_CLASS)}} components ({{color(#aa0000, instance)}} and {{color(#ff00ff, class)}} name)
471 2 Christoph Kappel
* [[Tagging|Tags]] are applied when a window is mapped - that is *before* the terminal launches "irssi":http://irssi.org
472 2 Christoph Kappel
473 1 Christoph Kappel
To safely [[Tagging|tag]] it's better to change the {{color(#aa0000, instance)}} name of the terminal like this:
474 1 Christoph Kappel
475 2 Christoph Kappel
<pre><code class="bash">urxvt -name irssi -e irssi</code></pre>
476 2 Christoph Kappel
477 2 Christoph Kappel
This results in following (via "xprop":http://www.xfree86.org/current/xprop.1.html):
478 2 Christoph Kappel
479 2 Christoph Kappel
<pre><code class="bash">{{color(#0000ff, WM_NAME)}}(STRING) = "irssi"
480 2 Christoph Kappel
{{color(#ff0000, WM_CLASS)}}(STRING) = {{color(#aa0000, "irssi")}}, {{color(#ff00ff, "URxvt")}}</code></pre>
481 2 Christoph Kappel
482 2 Christoph Kappel
A [[Tagging|tag]] for this could be:
483 2 Christoph Kappel
484 2 Christoph Kappel
<pre><code class="ruby">tag "irssi" do
485 2 Christoph Kappel
  match "irssi"
486 1 Christoph Kappel
end</code></pre>
487 2 Christoph Kappel
488 1 Christoph Kappel
Please keep in mind, that the {{color(#ff0000, WM_CLASS)}} {{color(#ff00ff, class)}} name is still *URxvt* and will match others [[Tagging|tags]] too.
489 2 Christoph Kappel
490 3 Christoph Kappel
h2.  How do I tag console based programs?
491 3 Christoph Kappel
492 2 Christoph Kappel
Generally [[subtle]] can apply [[Tagging|tags]] based on the {{color(#0000ff, WM_NAME)}} and both {{color(#ff0000, WM_CLASS)}} components. Console based programs like "irssi":http://irssi.org can be started like this and will change the {{color(#0000ff, WM_NAME)}} of the terminal:
493 2 Christoph Kappel
494 2 Christoph Kappel
<pre><code class="bash">urxvt -e irssi</code></pre>
495 2 Christoph Kappel
496 2 Christoph Kappel
Inspecting the terminal with "xprop":http://www.xfree86.org/current/xprop.1.html:
497 2 Christoph Kappel
498 2 Christoph Kappel
<pre><code class="bash">{{color(#0000ff, WM_NAME)}}(STRING) = "irssi"
499 2 Christoph Kappel
{{color(#ff0000, WM_CLASS)}}(STRING) = {{color(#aa0000, "urxvt")}}, {{color(#ff00ff, "URxvt")}}</code></pre>
500 2 Christoph Kappel
501 2 Christoph Kappel
So if we want to tag this window there are some things that should be considered:
502 2 Christoph Kappel
503 2 Christoph Kappel
* "irssi":http://irssi.org updates the {{color(#0000ff, WM_NAME)}} only
504 2 Christoph Kappel
* [[Tagging]] matches per default both {{color(#ff0000, WM_CLASS)}} components ({{color(#aa0000, instance)}} and {{color(#ff00ff, class)}} name)
505 2 Christoph Kappel
* [[Tagging|Tags]] are applied when a window is mapped - that is *before* the terminal launches "irssi":http://irssi.org
506 1 Christoph Kappel
507 1 Christoph Kappel
To safely [[Tagging|tag]] it's better to change the {{color(#aa0000, instance)}} name of the terminal like this:
508 2 Christoph Kappel
509 2 Christoph Kappel
<pre><code class="bash">urxvt -name irssi -e irssi</code></pre>
510 2 Christoph Kappel
511 2 Christoph Kappel
This results in following (via "xprop":http://www.xfree86.org/current/xprop.1.html):
512 2 Christoph Kappel
513 2 Christoph Kappel
<pre><code class="bash">{{color(#0000ff, WM_NAME)}}(STRING) = "irssi"
514 2 Christoph Kappel
{{color(#ff0000, WM_CLASS)}}(STRING) = {{color(#aa0000, "irssi")}}, {{color(#ff00ff, "URxvt")}}</code></pre>
515 2 Christoph Kappel
516 2 Christoph Kappel
A [[Tagging|tag]] for this could be:
517 2 Christoph Kappel
518 2 Christoph Kappel
<pre><code class="ruby">tag "irssi" do
519 1 Christoph Kappel
  match "irssi"
520 1 Christoph Kappel
end</code></pre>
521 1 Christoph Kappel
522 2 Christoph Kappel
Please keep in mind, that the {{color(#ff0000, WM_CLASS)}} {{color(#ff00ff, class)}} name is still *URxvt* and will match others [[Tagging|tags]] too.
523 2 Christoph Kappel
524 3 Christoph Kappel
h2.  How does subtle match clients?
525 3 Christoph Kappel
526 2 Christoph Kappel
[[subtle]] matches the {{color(#ff0000, WM_NAME)}} and the {{color(#0000ff, WM_CLASS)}} property of a window and not the title. This to ensure the match is correct. 
527 2 Christoph Kappel
There are several ways to get these values, here are the most common:
528 2 Christoph Kappel
529 2 Christoph Kappel
Select the window with "xprop":http://www.xfree86.org/current/xprop.1.htmland have a look for the {{color(#ff0000, WM_NAME)}} and {{color(#0000ff, WM_CLASS)}} lines which usually look like this:
530 2 Christoph Kappel
531 2 Christoph Kappel
<pre><code class="bash">{{color(#0000ff, WM_NAME)}}(STRING) = "urxvt"
532 1 Christoph Kappel
{{color(#ff0000, WM_CLASS)}}(STRING) = {{color(#aa0000, "irssi")}}, {{color(#ff00ff, "URxvt")}}</code></pre>
533 1 Christoph Kappel
534 2 Christoph Kappel
Run *[[subtler]] -cl* and look for the matching line:
535 2 Christoph Kappel
536 1 Christoph Kappel
<pre><code class="bash">0x800007 * 1 1020x374 2 1 --- {{color(#ff0000, urxvt)}} ({{color(#0000ff,URxvt)}})</code></pre>
537 2 Christoph Kappel
538 3 Christoph Kappel
h2.  How does subtle match clients?
539 3 Christoph Kappel
540 2 Christoph Kappel
[[subtle]] matches the {{color(#ff0000, WM_NAME)}} and the {{color(#0000ff, WM_CLASS)}} property of a window and not the title. This to ensure the match is correct. 
541 2 Christoph Kappel
There are several ways to get these values, here are the most common:
542 2 Christoph Kappel
543 2 Christoph Kappel
Select the window with "xprop":http://www.xfree86.org/current/xprop.1.htmland have a look for the {{color(#ff0000, WM_NAME)}} and {{color(#0000ff, WM_CLASS)}} lines which usually look like this:
544 2 Christoph Kappel
545 2 Christoph Kappel
<pre><code class="bash">{{color(#0000ff, WM_NAME)}}(STRING) = "urxvt"
546 2 Christoph Kappel
{{color(#ff0000, WM_CLASS)}}(STRING) = {{color(#aa0000, "irssi")}}, {{color(#ff00ff, "URxvt")}}</code></pre>
547 2 Christoph Kappel
548 1 Christoph Kappel
Run *[[subtler]] -cl* and look for the matching line:
549 2 Christoph Kappel
550 1 Christoph Kappel
<pre><code class="bash">0x800007 * 1 1020x374 2 1 --- {{color(#ff0000, urxvt)}} ({{color(#0000ff,URxvt)}})</code></pre>
551 1 Christoph Kappel
552 3 Christoph Kappel
h2.  How can I use subtle without numpad?
553 3 Christoph Kappel
554 2 Christoph Kappel
Per default [[subtle]] uses the numpad, because it's easier to remind the different postions when you can see them. Generally this is just a suggestion, it's up to you to change the grabs to your needs - any keys will work. 
555 2 Christoph Kappel
556 2 Christoph Kappel
Keys that also have proven to work well are *q-w-e*, *a-s-d* and *y-x-c*:
557 2 Christoph Kappel
558 2 Christoph Kappel
<pre><code class="ruby">grab "W-q", [ :top_left,     :top_left66,     :top_left33     ]
559 2 Christoph Kappel
grab "W-w", [ :top,          :top66,          :top33          ]
560 2 Christoph Kappel
grab "W-e", [ :top_right,    :top_right66,    :top_right33    ]
561 2 Christoph Kappel
grab "W-a", [ :left,         :left66,         :left33         ]
562 2 Christoph Kappel
grab "W-s", [ :center,       :center66,       :center33       ]
563 2 Christoph Kappel
grab "W-d", [ :right,        :right66,        :right33        ]
564 2 Christoph Kappel
grab "W-y", [ :bottom_left,  :bottom_left66,  :bottom_left33  ]
565 2 Christoph Kappel
grab "W-x", [ :bottom,       :bottom66,       :bottom33       ]
566 2 Christoph Kappel
grab "W-c", [ :bottom_right, :bottom_right66, :bottom_right33 ]
567 2 Christoph Kappel
</code></pre>
568 1 Christoph Kappel
569 2 Christoph Kappel
You can find more about assigning keys [[Grabs|here]].
570 1 Christoph Kappel
571 3 Christoph Kappel
h2.  How do I tag console based programs?
572 3 Christoph Kappel
573 2 Christoph Kappel
Generally [[subtle]] can apply [[Tagging|tags]] based on the {{color(#0000ff, WM_NAME)}} and both {{color(#ff0000, WM_CLASS)}} components. Console based programs like "irssi":http://irssi.org can be started like this and will change the {{color(#0000ff, WM_NAME)}} of the terminal:
574 2 Christoph Kappel
575 2 Christoph Kappel
<pre><code class="bash">urxvt -e irssi</code></pre>
576 2 Christoph Kappel
577 2 Christoph Kappel
Inspecting the terminal with "xprop":http://www.xfree86.org/current/xprop.1.html:
578 2 Christoph Kappel
579 2 Christoph Kappel
<pre><code class="bash">{{color(#0000ff, WM_NAME)}}(STRING) = "irssi"
580 2 Christoph Kappel
{{color(#ff0000, WM_CLASS)}}(STRING) = {{color(#aa0000, "urxvt")}}, {{color(#ff00ff, "URxvt")}}</code></pre>
581 2 Christoph Kappel
582 2 Christoph Kappel
So if we want to tag this window there are some things that should be considered:
583 1 Christoph Kappel
584 1 Christoph Kappel
* "irssi":http://irssi.org updates the {{color(#0000ff, WM_NAME)}} only
585 2 Christoph Kappel
* [[Tagging]] matches per default both {{color(#ff0000, WM_CLASS)}} components ({{color(#aa0000, instance)}} and {{color(#ff00ff, class)}} name)
586 2 Christoph Kappel
* [[Tagging|Tags]] are applied when a window is mapped - that is *before* the terminal launches "irssi":http://irssi.org
587 2 Christoph Kappel
588 2 Christoph Kappel
To safely [[Tagging|tag]] it's better to change the {{color(#aa0000, instance)}} name of the terminal like this:
589 2 Christoph Kappel
590 2 Christoph Kappel
<pre><code class="bash">urxvt -name irssi -e irssi</code></pre>
591 2 Christoph Kappel
592 2 Christoph Kappel
This results in following (via "xprop":http://www.xfree86.org/current/xprop.1.html):
593 2 Christoph Kappel
594 2 Christoph Kappel
<pre><code class="bash">{{color(#0000ff, WM_NAME)}}(STRING) = "irssi"
595 2 Christoph Kappel
{{color(#ff0000, WM_CLASS)}}(STRING) = {{color(#aa0000, "irssi")}}, {{color(#ff00ff, "URxvt")}}</code></pre>
596 2 Christoph Kappel
597 2 Christoph Kappel
A [[Tagging|tag]] for this could be:
598 2 Christoph Kappel
599 1 Christoph Kappel
<pre><code class="ruby">tag "irssi" do
600 2 Christoph Kappel
  match "irssi"
601 1 Christoph Kappel
end</code></pre>
602 2 Christoph Kappel
603 2 Christoph Kappel
Please keep in mind, that the {{color(#ff0000, WM_CLASS)}} {{color(#ff00ff, class)}} name is still *URxvt* and will match other [[Tagging|tags]] too.
604 2 Christoph Kappel
605 3 Christoph Kappel
h2.  How do I tag console based programs?
606 3 Christoph Kappel
607 2 Christoph Kappel
Generally [[subtle]] can apply [[Tagging|tags]] based on the {{color(#0000ff, WM_NAME)}} and both {{color(#ff0000, WM_CLASS)}} components. Console based programs like "irssi":http://irssi.org can be started like this and will change the {{color(#0000ff, WM_NAME)}} of the terminal:
608 2 Christoph Kappel
609 2 Christoph Kappel
<pre><code class="bash">urxvt -e irssi</code></pre>
610 2 Christoph Kappel
611 2 Christoph Kappel
Inspecting the terminal with "xprop":http://www.xfree86.org/current/xprop.1.html:
612 2 Christoph Kappel
613 2 Christoph Kappel
<pre><code class="bash">{{color(#0000ff, WM_NAME)}}(STRING) = "irssi"
614 2 Christoph Kappel
{{color(#ff0000, WM_CLASS)}}(STRING) = {{color(#aa0000, "urxvt")}}, {{color(#ff00ff, "URxvt")}}</code></pre>
615 2 Christoph Kappel
616 1 Christoph Kappel
So if we want to tag this window there are some things that should be considered:
617 1 Christoph Kappel
618 2 Christoph Kappel
* "irssi":http://irssi.org updates the {{color(#0000ff, WM_NAME)}} only
619 2 Christoph Kappel
* [[Tagging]] matches per default both {{color(#ff0000, WM_CLASS)}} components ({{color(#aa0000, instance)}} and {{color(#ff00ff, class)}} name)
620 2 Christoph Kappel
* [[Tagging|Tags]] are applied when a window is mapped - that is *before* the terminal launches "irssi":http://irssi.org
621 2 Christoph Kappel
622 2 Christoph Kappel
To safely [[Tagging|tag]] it's better to change the {{color(#aa0000, instance)}} name of the terminal like this:
623 2 Christoph Kappel
624 2 Christoph Kappel
<pre><code class="bash">urxvt -name irssi -e irssi</code></pre>
625 1 Christoph Kappel
626 1 Christoph Kappel
This results in following (via "xprop":http://www.xfree86.org/current/xprop.1.html):
627 2 Christoph Kappel
628 2 Christoph Kappel
<pre><code class="bash">{{color(#0000ff, WM_NAME)}}(STRING) = "irssi"
629 2 Christoph Kappel
{{color(#ff0000, WM_CLASS)}}(STRING) = {{color(#aa0000, "irssi")}}, {{color(#ff00ff, "URxvt")}}</code></pre>
630 2 Christoph Kappel
631 2 Christoph Kappel
A [[Tagging|tag]] for this could be:
632 2 Christoph Kappel
633 2 Christoph Kappel
<pre><code class="ruby">tag "irssi" do
634 1 Christoph Kappel
  match :instance => "irssi"
635 2 Christoph Kappel
end</code></pre>
636 1 Christoph Kappel
637 2 Christoph Kappel
Please keep in mind, that the {{color(#ff0000, WM_CLASS)}} {{color(#ff00ff, class)}} name is still *URxvt* and will match other [[Tagging|tags]] too.
638 2 Christoph Kappel
639 3 Christoph Kappel
h2.  How do I run a program on startup?
640 3 Christoph Kappel
641 2 Christoph Kappel
Let's say you want urxvt to start after subtle, and for some reason @echo "urxvt" >> ~/.xinitrc@ is just not cutting it. Using the :start hook and Subtlext we can simulate autostart like so:
642 1 Christoph Kappel
643 2 Christoph Kappel
<pre>
644 1 Christoph Kappel
on :start do
645 2 Christoph Kappel
  Subtlext::Subtle.spawn "urxvt"
646 2 Christoph Kappel
end
647 2 Christoph Kappel
</pre>
648 2 Christoph Kappel
649 3 Christoph Kappel
h2.  How can I use subtle without numpad?
650 3 Christoph Kappel
651 1 Christoph Kappel
Per default [[subtle]] uses the numpad, because it's easier to remind the different postions when you can see them. Generally this is just a suggestion, it's up to you to change the grabs to your needs - any keys will work. 
652 2 Christoph Kappel
653 2 Christoph Kappel
Keys that also have proven to work well are *q-w-e*, *a-s-d* and *y-x-c*:
654 2 Christoph Kappel
655 2 Christoph Kappel
<pre><code class="ruby">grab "W-q", [ :top_left,     :top_left66,     :top_left33     ]
656 2 Christoph Kappel
grab "W-w", [ :top,          :top66,          :top33          ]
657 2 Christoph Kappel
grab "W-e", [ :top_right,    :top_right66,    :top_right33    ]
658 2 Christoph Kappel
grab "W-a", [ :left,         :left66,         :left33         ]
659 2 Christoph Kappel
grab "W-s", [ :center,       :center66,       :center33       ]
660 2 Christoph Kappel
grab "W-d", [ :right,        :right66,        :right33        ]
661 2 Christoph Kappel
662 2 Christoph Kappel
# QWERTZ
663 2 Christoph Kappel
grab "W-y", [ :bottom_left,  :bottom_left66,  :bottom_left33  ]
664 2 Christoph Kappel
665 2 Christoph Kappel
# QWERTY
666 2 Christoph Kappel
grab "W-z", [ :bottom_left,  :bottom_left66,  :bottom_left33  ]
667 2 Christoph Kappel
668 1 Christoph Kappel
grab "W-x", [ :bottom,       :bottom66,       :bottom33       ]
669 2 Christoph Kappel
grab "W-c", [ :bottom_right, :bottom_right66, :bottom_right33 ]
670 2 Christoph Kappel
</code></pre>
671 2 Christoph Kappel
672 2 Christoph Kappel
673 2 Christoph Kappel
You can find more about assigning keys [[Grabs|here]].
674 2 Christoph Kappel
675 3 Christoph Kappel
h2.  How do I tag console based programs?
676 3 Christoph Kappel
677 2 Christoph Kappel
Generally [[subtle]] can apply [[Tagging|tags]] based on the {{color(#0000ff, WM_NAME)}} and both {{color(#ff0000, WM_CLASS)}} components. Console based programs like "irssi":http://irssi.org can be started like this and will change the {{color(#0000ff, WM_NAME)}} of the terminal:
678 2 Christoph Kappel
679 2 Christoph Kappel
<pre><code class="bash">urxvt -e irssi</code></pre>
680 2 Christoph Kappel
681 2 Christoph Kappel
Inspecting the terminal with "xprop":http://www.xfree86.org/current/xprop.1.html:
682 2 Christoph Kappel
683 2 Christoph Kappel
<pre><code class="bash">{{color(#0000ff, WM_NAME)}}(STRING) = "irssi"
684 2 Christoph Kappel
{{color(#ff0000, WM_CLASS)}}(STRING) = {{color(#aa0000, "urxvt")}}, {{color(#ff00ff, "URxvt")}}</code></pre>
685 2 Christoph Kappel
686 2 Christoph Kappel
So if we want to tag this window there are some things that should be considered:
687 1 Christoph Kappel
688 1 Christoph Kappel
* "irssi":http://irssi.org updates the {{color(#0000ff, WM_NAME)}} only
689 2 Christoph Kappel
* [[Tagging]] matches per default both {{color(#ff0000, WM_CLASS)}} components ({{color(#aa0000, instance)}} and {{color(#ff00ff, class)}} name)
690 2 Christoph Kappel
* [[Tagging|Tags]] are applied when a window is mapped - that is *before* the terminal launches "irssi":http://irssi.org
691 2 Christoph Kappel
692 2 Christoph Kappel
To safely [[Tagging|tag]] it's better to change the {{color(#aa0000, instance)}} name of the terminal like this:
693 2 Christoph Kappel
694 2 Christoph Kappel
<pre><code class="bash">urxvt -name irssi -e irssi</code></pre>
695 2 Christoph Kappel
696 2 Christoph Kappel
This results in following (via "xprop":http://www.xfree86.org/current/xprop.1.html):
697 2 Christoph Kappel
698 1 Christoph Kappel
<pre><code class="bash">{{color(#0000ff, WM_NAME)}}(STRING) = "irssi"
699 1 Christoph Kappel
{{color(#ff0000, WM_CLASS)}}(STRING) = {{color(#aa0000, "irssi")}}, {{color(#ff00ff, "URxvt")}}</code></pre>
700 2 Christoph Kappel
701 1 Christoph Kappel
A [[Tagging|tag]] for this could be:
702 1 Christoph Kappel
703 2 Christoph Kappel
<pre><code class="ruby">tag "irssi" do
704 1 Christoph Kappel
  match :instance => "irssi"
705 1 Christoph Kappel
end</code></pre>
706 2 Christoph Kappel
707 2 Christoph Kappel
Please keep in mind, that the {{color(#ff0000, WM_CLASS)}} {{color(#ff00ff, class)}} name is still *URxvt* and will match other [[Tagging|tags]] too. To avoid that there is the *exclude* match, it works similar to the normal match but excludes certain windows:
708 2 Christoph Kappel
709 1 Christoph Kappel
<pre><code class="ruby">tag "terms" do
710 2 Christoph Kappel
  exclude :instance => "irssi"
711 1 Christoph Kappel
end</code></pre>
712 2 Christoph Kappel
713 3 Christoph Kappel
h2.  Why does program XYZ appears/turns as/to a gray canvas?
714 3 Christoph Kappel
715 2 Christoph Kappel
Generally, this happens, when a program needs a specific aspect ratio and [[subtle]] sets a gravity that violates this. Windows can tell the window manager about this kind of preferences via their size hints and [[subtle]] can honor those:
716 2 Christoph Kappel
717 2 Christoph Kappel
# Enable size hints globally with the _:resize_ option
718 2 Christoph Kappel
  <pre>{{hide}}<code class="ruby">set :resize, true</code></pre>
719 2 Christoph Kappel
# Enable this per program via [[tagging|tag]]
720 1 Christoph Kappel
  <pre>{{hide}}<code class="ruby">tag "name"
721 1 Christoph Kappel
  match  "name"
722 1 Christoph Kappel
  resize true
723 1 Christoph Kappel
end
724 1 Christoph Kappel
725 3 Christoph Kappel
h2.  How can I delete a sublet manually?
726 3 Christoph Kappel
727 1 Christoph Kappel
[[Sublets]] usually consist of a *&#42;.rb* file, a *&#42;.spec* file and one or more icons. All these files can be found in their respective folder in @$XDG_DATA_HOME/subtle@ resp. @~/.local/share/subtle@. After deleting the [[sublets|sublet]] files the cache of [[sur]] needs to be updated or otherwise [[sur]] will think the [[sublets|sublet]] is still installed: @sur update -l@
728 1 Christoph Kappel
729 3 Christoph Kappel
h2.  How can I manually delete a sublet?
730 3 Christoph Kappel
731 1 Christoph Kappel
[[Sublets]] usually consist of a *&#42;.rb* file, a *&#42;.spec* file and one or more icons. All these files can be found in their respective folder in @$XDG_DATA_HOME/subtle@ resp. @~/.local/share/subtle@. After deleting the [[sublets|sublet]] files the cache of [[sur]] needs to be updated or otherwise [[sur]] will think the [[sublets|sublet]] is still installed: @sur update -l@
732 2 Christoph Kappel
733 3 Christoph Kappel
h2.  Where is the output window of flash in fullscreen?
734 3 Christoph Kappel
735 2 Christoph Kappel
For flash, browsers seem to use window instance and class names that doesn't match the browser values. Therefore the windows will usually appear on the default view.
736 2 Christoph Kappel
737 2 Christoph Kappel
Following names are currently in use:
738 2 Christoph Kappel
739 2 Christoph Kappel
|_. Browser |_. WM_NAME            |_. WM_CLASS                                 |
740 2 Christoph Kappel
| Firefox   | <unknown>            | "<unknown>", "<unknown>"                   |
741 2 Christoph Kappel
| Chromium  | exe                  | "exe", "Exe"                               |
742 2 Christoph Kappel
| Opera     | "operapluginwrapper" | "operapluginwrapper", "Operapluginwrapper" |
743 2 Christoph Kappel
744 1 Christoph Kappel
The easiest way to avoid that is to add a [[tagging|tag]] that makes these windows sticky:
745 2 Christoph Kappel
746 1 Christoph Kappel
<pre>{{hide}}<code class="ruby">tag "flash" do
747 2 Christoph Kappel
  match "<unkown>|exe|operapluginwrapper"
748 2 Christoph Kappel
  stick true
749 2 Christoph Kappel
end</code></pre>
750 2 Christoph Kappel
751 3 Christoph Kappel
h2.  How do I run a program on startup/autostart?
752 3 Christoph Kappel
753 1 Christoph Kappel
Let's say you want "urxvt":http://software.schmorp.de/pkg/rxvt-unicode.html to start after [[subtle]], and for some reason @echo "urxvt" >> ~/.xinitrc@ is just not cutting it. Using the *&#58;start* hook and [[subtlext]] we can simulate autostart like so:
754 1 Christoph Kappel
755 1 Christoph Kappel
<pre>{{hide}}<code class="ruby">
756 2 Christoph Kappel
on :start do
757 2 Christoph Kappel
  Subtlext::Subtle.spawn "urxvt"
758 2 Christoph Kappel
end
759 2 Christoph Kappel
</pre></code>
760 2 Christoph Kappel
761 3 Christoph Kappel
h2.  How do I start program xyz?
762 3 Christoph Kappel
763 2 Christoph Kappel
There are several way how to start a certain programm, here are the most common:
764 2 Christoph Kappel
765 2 Christoph Kappel
* Start your program via your $HOME/.xinitrc:
766 2 Christoph Kappel
767 2 Christoph Kappel
<pre><code class="ruby">
768 2 Christoph Kappel
subtle &
769 2 Christoph Kappel
PID=$!
770 2 Christoph Kappel
sleep 2
771 2 Christoph Kappel
urxvt
772 1 Christoph Kappel
wait $PID
773 2 Christoph Kappel
</code></pre>
774 1 Christoph Kappel
775 1 Christoph Kappel
* Start your program via [[grabs]]:
776 1 Christoph Kappel
777 2 Christoph Kappel
<pre><code class="ruby">
778 2 Christoph Kappel
"A-x" => "urxvt"
779 2 Christoph Kappel
</code></pre>
780 2 Christoph Kappel
781 2 Christoph Kappel
Additionally there are many launchers available like "dmenu":http://tools.suckless.org/dmenu and there is even a launcher especially designed for [[subtle]], you can find it in "subtle-contrib":http://subforge.org/projects/subtle-contrib/wiki#Launcher.
782 2 Christoph Kappel
783 2 Christoph Kappel
784 3 Christoph Kappel
h2.  How do I start program XYZ?
785 3 Christoph Kappel
786 2 Christoph Kappel
There are several way how to start a certain programm, here are the most common:
787 1 Christoph Kappel
788 1 Christoph Kappel
* Start your program via your $HOME/.xinitrc:
789 2 Christoph Kappel
790 2 Christoph Kappel
<pre><code class="ruby">
791 2 Christoph Kappel
subtle &
792 2 Christoph Kappel
PID=$!
793 2 Christoph Kappel
sleep 2
794 2 Christoph Kappel
urxvt
795 1 Christoph Kappel
wait $PID
796 2 Christoph Kappel
</code></pre>
797 1 Christoph Kappel
798 2 Christoph Kappel
* Start your program via [[grabs]]:
799 2 Christoph Kappel
800 1 Christoph Kappel
<pre><code class="ruby">
801 1 Christoph Kappel
"A-x" => "urxvt"
802 2 Christoph Kappel
</code></pre>
803 2 Christoph Kappel
804 2 Christoph Kappel
Additionally there are many launchers available like "dmenu":http://tools.suckless.org/dmenu and there is even a launcher especially designed for [[subtle]], you can find it in "subtle-contrib":http://subforge.org/projects/subtle-contrib/wiki#Launcher.
805 2 Christoph Kappel
806 2 Christoph Kappel
807 3 Christoph Kappel
h2.  Why does program XYZ appears/turns as/to a gray canvas?
808 3 Christoph Kappel
809 1 Christoph Kappel
Generally, this happens, when a program needs a specific aspect ratio and [[subtle]] sets a gravity that violates this. Windows can tell the window manager about this kind of preferences via their size hints and [[subtle]] can honor those.
810 2 Christoph Kappel
811 2 Christoph Kappel
There are two possible ways:
812 2 Christoph Kappel
813 2 Christoph Kappel
# Enable size hints globally with the _:resize_ option
814 2 Christoph Kappel
  <pre>{{hide}}<code class="ruby">set :resize, true</code></pre>
815 2 Christoph Kappel
# Enable this per program via [[tagging|tag]]
816 2 Christoph Kappel
  <pre>{{hide}}<code class="ruby">tag "name"
817 2 Christoph Kappel
  match  "name"
818 2 Christoph Kappel
  resize true
819 1 Christoph Kappel
end
820 1 Christoph Kappel
821 3 Christoph Kappel
h2.  Why does program XYZ appears/turns as/to a gray canvas?
822 3 Christoph Kappel
823 1 Christoph Kappel
Generally, this happens, when a program needs a specific aspect ratio and [[subtle]] sets a gravity that violates this. Windows can tell the window manager about this kind of preferences via their size hints and [[subtle]] can honor those.
824 2 Christoph Kappel
825 2 Christoph Kappel
There are two possible ways:
826 2 Christoph Kappel
827 1 Christoph Kappel
# Enable size hints globally with the _&#58;resize_ option
828 1 Christoph Kappel
  <pre>{{hide}}<code class="ruby">set :resize, true</code></pre>
829 2 Christoph Kappel
# Enable this per program via [[tagging|tag]]
830 2 Christoph Kappel
  <pre>{{hide}}<code class="ruby">tag "name"
831 2 Christoph Kappel
  match  "name"
832 2 Christoph Kappel
  resize true
833 2 Christoph Kappel
end
834 2 Christoph Kappel
835 3 Christoph Kappel
h2.  How do I run a java program?
836 3 Christoph Kappel
837 2 Christoph Kappel
"Java":http://java.com *expects* a certain behaviour (_reparenting of client windows_) of a window manager which is not part of any standard, therefore some "Java":http://java.com programs just show a white canvas.
838 2 Christoph Kappel
839 2 Christoph Kappel
If this happens just try to start your program like this:
840 1 Christoph Kappel
841 2 Christoph Kappel
<pre><code class="shell">AWT_TOOLKIT=MToolkit program</code></pre>
842 1 Christoph Kappel
843 2 Christoph Kappel
This changes the default tookit of "Java":http://java.com to MToolkit, which is known to work with non-reparenting windows managers like [[subtle]]. Depending on your "OpenJDK":http://openjdk.java.net version and your architecture this may either lead to a segmentation fault or your "OpenJDK":http://openjdk.java.net just has no support for *MToolkit*. In this case check if your distribution has applied a patch for this issue which allows something like this to change the default behaviour:
844 2 Christoph Kappel
845 2 Christoph Kappel
<pre><code class="shell">_JAVA_AWT_WM_NONREPARENTING=1 program</code></pre>
846 1 Christoph Kappel
847 2 Christoph Kappel
In case both doesn't work there is a third option: The JDK internally uses a hardcoded list of window managers that are non-reparenting, the "suckless":http://suckless.org guys made the tool "wmname":http://tools.suckless.org/wmname to change the name of the wm and just lie to Java. 
848 1 Christoph Kappel
849 2 Christoph Kappel
Generally this problem is really long lasting, see here: 
850 2 Christoph Kappel
851 2 Christoph Kappel
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6511454
852 1 Christoph Kappel
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=508650
853 1 Christoph Kappel
854 2 Christoph Kappel
855 1 Christoph Kappel
856 3 Christoph Kappel
h2.  How do I set a wallpaper in subtle?
857 3 Christoph Kappel
858 2 Christoph Kappel
On start, [[subtle]] sets a background color (_if set_) to the root window and therefore *overwrites* any root pixmap set before. To avoid this, you just need to comment out the *&#58;background* line from your config.
859 2 Christoph Kappel
860 2 Christoph Kappel
[[subtle]] itself has no and will never have either an autostart or way to set a wallpaper directly. Normally you just want to setup your X session and and not [[subtle]]. Your _~/.xinitrc_ is the right place for stuff like this.
861 2 Christoph Kappel
862 2 Christoph Kappel
A background can easily set with a tool like "feh":http://linuxbrit.co.uk/software/feh/.
863 2 Christoph Kappel
864 3 Christoph Kappel
h2.  How can I use subtle without numpad?
865 3 Christoph Kappel
866 2 Christoph Kappel
Per default [[subtle]] uses the numpad, because it's easier to remind the different postions when you can see them. Generally this is just a suggestion, it's up to you to change the grabs to your needs - any keys will work. 
867 1 Christoph Kappel
868 2 Christoph Kappel
Keys that also have proven to work well are *q-w-e*, *a-s-d* and *y-x-c*:
869 2 Christoph Kappel
870 2 Christoph Kappel
<pre>{{hide}}<code class="ruby">grab "W-q", [ :top_left,     :top_left66,     :top_left33     ]
871 2 Christoph Kappel
grab "W-w", [ :top,          :top66,          :top33          ]
872 2 Christoph Kappel
grab "W-e", [ :top_right,    :top_right66,    :top_right33    ]
873 2 Christoph Kappel
grab "W-a", [ :left,         :left66,         :left33         ]
874 2 Christoph Kappel
grab "W-s", [ :center,       :center66,       :center33       ]
875 2 Christoph Kappel
grab "W-d", [ :right,        :right66,        :right33        ]
876 1 Christoph Kappel
877 1 Christoph Kappel
# QWERTZ
878 1 Christoph Kappel
grab "W-y", [ :bottom_left,  :bottom_left66,  :bottom_left33  ]
879 2 Christoph Kappel
880 1 Christoph Kappel
# QWERTY
881 2 Christoph Kappel
grab "W-z", [ :bottom_left,  :bottom_left66,  :bottom_left33  ]
882 1 Christoph Kappel
883 2 Christoph Kappel
grab "W-x", [ :bottom,       :bottom66,       :bottom33       ]
884 2 Christoph Kappel
grab "W-c", [ :bottom_right, :bottom_right66, :bottom_right33 ]
885 2 Christoph Kappel
</code></pre>
886 2 Christoph Kappel
887 2 Christoph Kappel
888 2 Christoph Kappel
You can find more about assigning keys [[Grabs|here]].
889 2 Christoph Kappel
890 3 Christoph Kappel
h2.  How do I move program xyz to view abc?
891 3 Christoph Kappel
892 1 Christoph Kappel
Placement in [[subtle]] is +strict+ and completely done via the [[tagging]]. There are many ways to change tags per runtime, common is to use either [[subtler]] or [[subtlext]].
893 2 Christoph Kappel
894 3 Christoph Kappel
h2.  subtler
895 2 Christoph Kappel
896 3 Christoph Kappel
897 1 Christoph Kappel
[[subtler]] can be used on the commandline:
898 2 Christoph Kappel
899 1 Christoph Kappel
<pre>{{hide}}<code class="ruby">
900 2 Christoph Kappel
subtler -ta tag         #< Add new tag 'tag'
901 1 Christoph Kappel
subtler -cT client tag  #< Tag client 'client' with tag 'tag'
902 2 Christoph Kappel
subtler -vT view tag    #< Tag view 'view' with tag 'tag'
903 2 Christoph Kappel
</code></pre>
904 2 Christoph Kappel
905 3 Christoph Kappel
h2.  subtlext
906 2 Christoph Kappel
907 3 Christoph Kappel
908 2 Christoph Kappel
[[subtlext]] requires basic "ruby":http://ruby-lang.org knowledge:
909 1 Christoph Kappel
910 2 Christoph Kappel
<pre>{{hide}}<code class="ruby">require "subtle/subtlext"
911 1 Christoph Kappel
912 2 Christoph Kappel
tag = Subtlext::Tag.new("tag").save  #< Add new tag 'tag'
913 2 Christoph Kappel
Subtlext::Client["client"] + "tag"   #< Tag client 'client' with tag 'tag'
914 2 Christoph Kappel
Subtlext::View["view"] + "tag"       #< Tag view 'view' with tag 'tag'
915 2 Christoph Kappel
</code></pre>
916 2 Christoph Kappel
917 3 Christoph Kappel
h2.  Snippets
918 2 Christoph Kappel
919 3 Christoph Kappel
920 1 Christoph Kappel
The [[snippets]] wiki page includes examples how to "move":http://subforge.org/wiki/subtle/Snippets#Move-windows windows to another view.
921 2 Christoph Kappel
922 3 Christoph Kappel
h2.  Contrib
923 2 Christoph Kappel
924 3 Christoph Kappel
925 2 Christoph Kappel
h3. Vitag
926 1 Christoph Kappel
927 2 Christoph Kappel
"subtle-contrib":http://subforge.org/projects/subtle-contrib/wiki contains "vitag":http://subforge.org/projects/subtle-contrib/wiki#Vitag, a script to change the [[tagging|tags]] of windows and views with an editor.
928 2 Christoph Kappel
929 2 Christoph Kappel
h3. Launcher
930 2 Christoph Kappel
931 1 Christoph Kappel
The "launcher":http://subforge.org/projects/subtle-contrib/wiki#Launcher uses quite the opposite way, instead of moving a window to a certain screen it just provides a way to launch a window directly on the right view with the correct [[tagging|tags]].
932 2 Christoph Kappel
933 3 Christoph Kappel
h2.  Stick
934 1 Christoph Kappel
935 3 Christoph Kappel
936 1 Christoph Kappel
Most of the time, setting the window to *stick* does the trick too. Stick just displays the window on all views until the mode is disabled again. This can be done with [[grabs]] (default keys: W-s) or with [[subtler]]. (click on the window: subtler -cXS)
937 2 Christoph Kappel
938 2 Christoph Kappel
939 2 Christoph Kappel
940 3 Christoph Kappel
h2.  How do I move program xyz to view abc?
941 3 Christoph Kappel
942 2 Christoph Kappel
Placement in [[subtle]] is +strict+ and completely done via the [[tagging]]. There are many ways to change tags per runtime, common is to use either [[subtler]] or [[subtlext]].
943 1 Christoph Kappel
944 3 Christoph Kappel
h2.  subtler
945 1 Christoph Kappel
946 3 Christoph Kappel
947 2 Christoph Kappel
[[subtler]] can be used on the commandline:
948 2 Christoph Kappel
949 2 Christoph Kappel
<pre>{{hide}}<code class="ruby">
950 2 Christoph Kappel
subtler -ta tag         #< Add new tag 'tag'
951 2 Christoph Kappel
subtler -cT client tag  #< Tag client 'client' with tag 'tag'
952 2 Christoph Kappel
subtler -vT view tag    #< Tag view 'view' with tag 'tag'
953 1 Christoph Kappel
</code></pre>
954 2 Christoph Kappel
955 3 Christoph Kappel
h2.  subtlext
956 2 Christoph Kappel
957 3 Christoph Kappel
958 2 Christoph Kappel
[[subtlext]] requires basic "ruby":http://ruby-lang.org knowledge:
959 2 Christoph Kappel
960 2 Christoph Kappel
<pre>{{hide}}<code class="ruby">require "subtle/subtlext"
961 2 Christoph Kappel
962 2 Christoph Kappel
tag = Subtlext::Tag.new("tag").save  #< Add new tag 'tag'
963 2 Christoph Kappel
Subtlext::Client["client"] + "tag"   #< Tag client 'client' with tag 'tag'
964 1 Christoph Kappel
Subtlext::View["view"] + "tag"       #< Tag view 'view' with tag 'tag'
965 2 Christoph Kappel
</code></pre>
966 1 Christoph Kappel
967 3 Christoph Kappel
h2.  Snippets
968 1 Christoph Kappel
969 3 Christoph Kappel
970 1 Christoph Kappel
The [[snippets]] wiki page includes examples how to "move":http://subforge.org/wiki/subtle/Snippets#Move-windows windows to another view.
971 2 Christoph Kappel
972 3 Christoph Kappel
h2.  Contrib
973 2 Christoph Kappel
974 3 Christoph Kappel
975 2 Christoph Kappel
h3. Vitag
976 2 Christoph Kappel
977 2 Christoph Kappel
"subtle-contrib":http://subforge.org/projects/subtle-contrib/wiki contains "vitag":http://subforge.org/projects/subtle-contrib/wiki#Vitag, a script to change the [[tagging|tags]] of windows and views with an editor.
978 1 Christoph Kappel
979 2 Christoph Kappel
h3. Launcher
980 1 Christoph Kappel
981 2 Christoph Kappel
The "launcher":http://subforge.org/projects/subtle-contrib/wiki#Launcher uses quite the opposite way, instead of moving a window to a certain screen it just provides a way to launch a window directly on the right view with the correct [[tagging|tags]].
982 2 Christoph Kappel
983 3 Christoph Kappel
h2.  Stick
984 1 Christoph Kappel
985 3 Christoph Kappel
986 2 Christoph Kappel
Most of the time, setting the window to *stick* does the trick too. Stick just displays the window on all views until the mode is disabled again. This can be done with [[grabs]] (default keys: *W-s*) or with [[subtler]]. (click on the window: @subtler -cXS@)
987 2 Christoph Kappel
988 2 Christoph Kappel
989 1 Christoph Kappel
990 3 Christoph Kappel
h2.  How do I move program xyz to view abc?
991 3 Christoph Kappel
992 2 Christoph Kappel
Placement in [[subtle]] is +strict+ and completely done via [[tagging]]. There are many ways to change [[tagging|tags]] per runtime, common is to use either [[subtler]] or [[subtlext]].
993 2 Christoph Kappel
994 3 Christoph Kappel
h2.  subtler
995 2 Christoph Kappel
996 3 Christoph Kappel
997 2 Christoph Kappel
[[subtler]] can be used on the commandline:
998 2 Christoph Kappel
999 2 Christoph Kappel
<pre>{{hide}}<code class="ruby">
1000 2 Christoph Kappel
subtler -ta tag         #< Add new tag 'tag'
1001 2 Christoph Kappel
subtler -cT client tag  #< Tag client 'client' with tag 'tag'
1002 2 Christoph Kappel
subtler -vT view tag    #< Tag view 'view' with tag 'tag'
1003 2 Christoph Kappel
</code></pre>
1004 2 Christoph Kappel
1005 3 Christoph Kappel
h2.  subtlext
1006 1 Christoph Kappel
1007 3 Christoph Kappel
1008 2 Christoph Kappel
[[subtlext]] requires basic "ruby":http://ruby-lang.org knowledge:
1009 2 Christoph Kappel
1010 2 Christoph Kappel
<pre>{{hide}}<code class="ruby">require "subtle/subtlext"
1011 2 Christoph Kappel
1012 2 Christoph Kappel
tag = Subtlext::Tag.new("tag").save  #< Add new tag 'tag'
1013 2 Christoph Kappel
Subtlext::Client["client"] + "tag"   #< Tag client 'client' with tag 'tag'
1014 2 Christoph Kappel
Subtlext::View["view"] + "tag"       #< Tag view 'view' with tag 'tag'
1015 2 Christoph Kappel
</code></pre>
1016 2 Christoph Kappel
1017 3 Christoph Kappel
h2.  Snippets
1018 2 Christoph Kappel
1019 3 Christoph Kappel
1020 2 Christoph Kappel
The [[snippets]] wiki page includes examples how to "move":http://subforge.org/wiki/subtle/Snippets#Move-windows windows to another view.
1021 1 Christoph Kappel
1022 3 Christoph Kappel
h2.  Contrib
1023 2 Christoph Kappel
1024 3 Christoph Kappel
1025 2 Christoph Kappel
h3. Vitag
1026 2 Christoph Kappel
1027 2 Christoph Kappel
"subtle-contrib":http://subforge.org/projects/subtle-contrib/wiki contains "vitag":http://subforge.org/projects/subtle-contrib/wiki#Vitag, a script to change the [[tagging|tags]] of windows and views with an editor.
1028 2 Christoph Kappel
1029 2 Christoph Kappel
h3. Launcher
1030 2 Christoph Kappel
1031 2 Christoph Kappel
The "launcher":http://subforge.org/projects/subtle-contrib/wiki#Launcher uses quite the opposite way, instead of moving a window to a certain screen it just provides a way to launch a window directly on the right view with the correct [[tagging|tags]].
1032 2 Christoph Kappel
1033 3 Christoph Kappel
h2.  Stick
1034 1 Christoph Kappel
1035 3 Christoph Kappel
1036 1 Christoph Kappel
Most of the time, setting the window to *stick* does the trick too. Stick just displays the window on all views until the mode is disabled again. This can be done with [[grabs]] (default keys: *W-s*) or with [[subtler]]. (click on the window: @subtler -cXS@)
1037 2 Christoph Kappel
1038 2 Christoph Kappel
1039 2 Christoph Kappel
1040 3 Christoph Kappel
h2.  How do I run a java program?
1041 3 Christoph Kappel
1042 2 Christoph Kappel
"Java":http://java.com *expects* a certain behaviour (_reparenting of client windows_) of a window manager which is not part of any standard, therefore some "Java":http://java.com programs just show a white canvas.
1043 1 Christoph Kappel
1044 1 Christoph Kappel
If this happens just try to start your program like this:
1045 2 Christoph Kappel
1046 2 Christoph Kappel
<pre><code class="shell">AWT_TOOLKIT=MToolkit program</code></pre>
1047 2 Christoph Kappel
1048 2 Christoph Kappel
This changes the default tookit of "Java":http://java.com to _MToolkit_, which is known to work with non-reparenting windows managers like [[subtle]]. Depending on your "OpenJDK":http://openjdk.java.net version and your architecture this may either lead to a segmentation fault or your "OpenJDK":http://openjdk.java.net just has no support for *MToolkit*. In this case check if your distribution has applied a patch for this issue which allows something like this to change the default behaviour:
1049 2 Christoph Kappel
1050 2 Christoph Kappel
<pre><code class="shell">_JAVA_AWT_WM_NONREPARENTING=1 program</code></pre>
1051 2 Christoph Kappel
1052 2 Christoph Kappel
In case both doesn't work there is a third option: The JDK internally uses a hardcoded list of window managers that are non-reparenting, the "suckless":http://suckless.org guys made the tool "wmname":http://tools.suckless.org/wmname to change the name of the wm and just lie to Java. 
1053 2 Christoph Kappel
1054 2 Christoph Kappel
Generally this problem is really long lasting, see here: 
1055 1 Christoph Kappel
1056 2 Christoph Kappel
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6511454
1057 1 Christoph Kappel
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=508650
1058 1 Christoph Kappel
1059 1 Christoph Kappel
bq. Note: Many problems only affect the "JRE":http://www.oracle.com/technetwork/java/javase/downloads/index.html and can be avoided by using the "OpenJDK":http://openjdk.java.net.
1060 2 Christoph Kappel
1061 2 Christoph Kappel
1062 2 Christoph Kappel
1063 3 Christoph Kappel
h2.  Why does program XYZ appears/turns as/to a gray canvas?
1064 3 Christoph Kappel
1065 2 Christoph Kappel
Generally, this happens, when a program needs a specific aspect ratio and [[subtle]] sets a gravity that violates this. Windows can tell the window manager about this kind of preferences via their size hints and [[subtle]] can honor those.
1066 2 Christoph Kappel
1067 2 Christoph Kappel
There are two possible ways:
1068 2 Christoph Kappel
1069 2 Christoph Kappel
# Enable size hints globally with the _&#58;resize_ option
1070 2 Christoph Kappel
  <pre>{{hide}}<code class="ruby">set :resize, true</code></pre>
1071 1 Christoph Kappel
# Enable this per program via [[tagging|tag]]
1072 2 Christoph Kappel
  <pre>{{hide}}<code class="ruby">tag "name"
1073 1 Christoph Kappel
  match  "name"
1074 1 Christoph Kappel
  resize true
1075 2 Christoph Kappel
end
1076 1 Christoph Kappel
1077 1 Christoph Kappel
.bq Note: This can happen with "java":http://java.com too, see "here":http://subforge.org/ezfaq/show/subtle?faq_id=14 for more information.
1078 2 Christoph Kappel
1079 3 Christoph Kappel
h2.  How do I run a Java program?
1080 3 Christoph Kappel
1081 2 Christoph Kappel
"Java":http://java.com *expects* a certain behaviour (_reparenting of client windows_) of a window manager which is not part of any standard, therefore some "Java":http://java.com programs just show a white canvas.
1082 2 Christoph Kappel
1083 2 Christoph Kappel
If this happens just try to start your program like this:
1084 2 Christoph Kappel
1085 2 Christoph Kappel
<pre><code class="shell">AWT_TOOLKIT=MToolkit program</code></pre>
1086 2 Christoph Kappel
1087 2 Christoph Kappel
This changes the default tookit of "Java":http://java.com to _MToolkit_, which is known to work with non-reparenting windows managers like [[subtle]]. Depending on your "OpenJDK":http://openjdk.java.net version and your architecture this may either lead to a segmentation fault or your "OpenJDK":http://openjdk.java.net just has no support for *MToolkit*. In this case check if your distribution has applied a patch for this issue which allows something like this to change the default behaviour:
1088 2 Christoph Kappel
1089 2 Christoph Kappel
<pre><code class="shell">_JAVA_AWT_WM_NONREPARENTING=1 program</code></pre>
1090 2 Christoph Kappel
1091 2 Christoph Kappel
In case both doesn't work there is a third option: The JDK internally uses a hardcoded list of window managers that are non-reparenting, the "suckless":http://suckless.org guys made the tool "wmname":http://tools.suckless.org/wmname to change the name of the wm and just lie to Java. 
1092 2 Christoph Kappel
1093 1 Christoph Kappel
Generally this problem is really long lasting, see here: 
1094 2 Christoph Kappel
1095 1 Christoph Kappel
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6511454
1096 2 Christoph Kappel
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=508650
1097 2 Christoph Kappel
1098 1 Christoph Kappel
bq. Note: Many problems only affect the "JRE":http://www.oracle.com/technetwork/java/javase/downloads/index.html and can be avoided by using the "OpenJDK":http://openjdk.java.net.
1099 1 Christoph Kappel
1100 2 Christoph Kappel
1101 2 Christoph Kappel
1102 3 Christoph Kappel
h2.  Why does program XYZ appears/turns as/to a gray canvas?
1103 3 Christoph Kappel
1104 2 Christoph Kappel
Generally, this happens, when a program needs a specific aspect ratio and [[subtle]] sets a gravity that violates this. Windows can tell the window manager about this kind of preferences via their size hints and [[subtle]] can honor those.
1105 2 Christoph Kappel
1106 2 Christoph Kappel
There are two possible ways:
1107 2 Christoph Kappel
1108 2 Christoph Kappel
# Enable size hints globally with the _&#58;resize_ option
1109 1 Christoph Kappel
  <pre>{{hide}}<code class="ruby">set :resize, true</code></pre>
1110 2 Christoph Kappel
# Enable this per program via [[tagging|tag]]
1111 1 Christoph Kappel
  <pre>{{hide}}<code class="ruby">tag "name"
1112 2 Christoph Kappel
  match  "name"
1113 2 Christoph Kappel
  resize true
1114 2 Christoph Kappel
end</code></pre>
1115 2 Christoph Kappel
1116 2 Christoph Kappel
bq. Note: This can happen with "java":http://java.com too, see "here":http://subforge.org/ezfaq/show/subtle?faq_id=14 for more information.
1117 2 Christoph Kappel
1118 3 Christoph Kappel
h2.  Why does program XYZ appears/turns as/to a gray canvas?
1119 3 Christoph Kappel
1120 2 Christoph Kappel
Generally, this happens, when a program needs a specific aspect ratio and [[subtle]] sets a gravity that violates this. Windows can tell the window manager about this kind of preferences via their size hints and [[subtle]] can honor those.
1121 2 Christoph Kappel
1122 1 Christoph Kappel
There are two possible ways:
1123 1 Christoph Kappel
1124 1 Christoph Kappel
# Enable size hints globally with the _&#58;resize_ option
1125 1 Christoph Kappel
  <pre>{{hide}}<code class="ruby">set :resize, true</code></pre>
1126 1 Christoph Kappel
# Enable this per program via [[tagging|tag]]
1127 2 Christoph Kappel
  <pre>{{hide}}<code class="ruby">tag "name"
1128 1 Christoph Kappel
  match  "name"
1129 2 Christoph Kappel
  resize true
1130 2 Christoph Kappel
end</code></pre>
1131 2 Christoph Kappel
1132 2 Christoph Kappel
bq. Note: This can happen with "Java":http://java.com too, see "here":http://subforge.org/ezfaq/show/subtle?faq_id=14 for more information.
1133 2 Christoph Kappel
1134 3 Christoph Kappel
h2.  Is there any log file?
1135 3 Christoph Kappel
1136 2 Christoph Kappel
Nope, there is *no* log file. In case you need one for e.g. reporting a bug +please+ read to the [[bugs|reporting a bug]] wiki page and check the paragraph about [[bugs#enable-logging|logging]].
1137 2 Christoph Kappel
1138 3 Christoph Kappel
h2.  How do I run a Java program?
1139 3 Christoph Kappel
1140 1 Christoph Kappel
"Java":http://java.com *expects* a certain behaviour (_reparenting of client windows_) of a window manager which is not part of any standard, therefore some "Java":http://java.com programs just show a white canvas.
1141 2 Christoph Kappel
1142 2 Christoph Kappel
If this happens just try to start your program like this:
1143 2 Christoph Kappel
1144 2 Christoph Kappel
<pre><code class="shell">AWT_TOOLKIT=MToolkit program</code></pre>
1145 2 Christoph Kappel
1146 1 Christoph Kappel
This changes the default tookit of "Java":http://java.com to _MToolkit_, which is known to work with non-reparenting windows managers like [[subtle]]. Depending on your "OpenJDK":http://openjdk.java.net version and your architecture this may either lead to a segmentation fault or your "OpenJDK":http://openjdk.java.net just has no support for *MToolkit*. In this case check if your distribution has applied a patch for this issue which allows something like this to change the default behaviour:
1147 1 Christoph Kappel
1148 2 Christoph Kappel
<pre><code class="shell">_JAVA_AWT_WM_NONREPARENTING=1 program</code></pre>
1149 2 Christoph Kappel
1150 2 Christoph Kappel
In case both doesn't work there is a third option: "Java":http://java.com seems to use an internally hardcoded list of window managers that are non-reparenting, the "suckless":http://suckless.org guys made a tool ("wmname":http://tools.suckless.org/wmname) to change the name of the wm. Since r2520 [[subtle]] can do that for you, just enable the *&#58;wmname* option.
1151 2 Christoph Kappel
1152 2 Christoph Kappel
Generally this problem is really long lasting, see here: 
1153 2 Christoph Kappel
1154 2 Christoph Kappel
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6511454
1155 2 Christoph Kappel
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=508650
1156 2 Christoph Kappel
1157 1 Christoph Kappel
bq. Note: Many problems only affect the "JRE":http://www.oracle.com/technetwork/java/javase/downloads/index.html and can be avoided by using the "OpenJDK":http://openjdk.java.net.
1158 1 Christoph Kappel
1159 2 Christoph Kappel
1160 2 Christoph Kappel
1161 3 Christoph Kappel
h2.  How do I run a Java program?
1162 3 Christoph Kappel
1163 2 Christoph Kappel
"Java":http://java.com *expects* a certain behaviour (_reparenting of client windows_) of a window manager which is not part of any standard, therefore some "Java":http://java.com programs just show a white canvas.
1164 2 Christoph Kappel
1165 2 Christoph Kappel
If this happens just try to start your program like this:
1166 2 Christoph Kappel
1167 2 Christoph Kappel
<pre><code class="shell">AWT_TOOLKIT=MToolkit program</code></pre>
1168 1 Christoph Kappel
1169 2 Christoph Kappel
This changes the default tookit of "Java":http://java.com to _MToolkit_, which is known to work with non-reparenting windows managers like [[subtle]]. Depending on your "OpenJDK":http://openjdk.java.net version and your architecture this may either lead to a segmentation fault or your "OpenJDK":http://openjdk.java.net just has no support for *MToolkit*. In this case check if your distribution has applied a patch for this issue which allows something like this to change the default behaviour:
1170 1 Christoph Kappel
1171 2 Christoph Kappel
<pre><code class="shell">_JAVA_AWT_WM_NONREPARENTING=1 program</code></pre>
1172 2 Christoph Kappel
1173 2 Christoph Kappel
In case both doesn't work there is a third option: "Java":http://java.com seems to use an internally hardcoded list of window managers that are non-reparenting, the "suckless":http://suckless.org guys made a tool ("wmname":http://tools.suckless.org/wmname) to change the name of the wm.
1174 2 Christoph Kappel
1175 1 Christoph Kappel
Since r2520 [[subtle]] can do that for you, just enable the *&#58;wmname* option.
1176 1 Christoph Kappel
1177 2 Christoph Kappel
Generally this problem is really long lasting, see here: 
1178 2 Christoph Kappel
1179 2 Christoph Kappel
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6511454
1180 2 Christoph Kappel
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=508650
1181 2 Christoph Kappel
1182 2 Christoph Kappel
bq. Note: Many problems only affect the "JRE":http://www.oracle.com/technetwork/java/javase/downloads/index.html and can be avoided by using the "OpenJDK":http://openjdk.java.net.
1183 2 Christoph Kappel
1184 1 Christoph Kappel
1185 2 Christoph Kappel
1186 3 Christoph Kappel
h2.  Where is the output window of flash in fullscreen?
1187 3 Christoph Kappel
1188 1 Christoph Kappel
For flash, browsers seem to use window instance and class names that doesn't match the browser values. Therefore the windows will usually appear on the default view.
1189 1 Christoph Kappel
1190 2 Christoph Kappel
Following names are currently in use:
1191 1 Christoph Kappel
1192 2 Christoph Kappel
|_. Browser |_. WM_NAME            |_. WM_CLASS                                 |
1193 1 Christoph Kappel
| Firefox   | <unknown>            | "<unknown>", "<unknown>"                   |
1194 2 Christoph Kappel
| Chromium  | exe                  | "exe", "Exe"                               |
1195 2 Christoph Kappel
| Opera     | "operapluginwrapper" | "operapluginwrapper", "Operapluginwrapper" |
1196 2 Christoph Kappel
1197 2 Christoph Kappel
The easiest way to avoid that is to add a [[tagging|tag]] that makes these windows sticky:
1198 2 Christoph Kappel
1199 2 Christoph Kappel
<pre>{{hide}}<code class="ruby">tag "flash" do
1200 2 Christoph Kappel
  match "<unknown>|exe|operapluginwrapper"
1201 1 Christoph Kappel
  stick true
1202 2 Christoph Kappel
end</code></pre>
1203 1 Christoph Kappel
1204 3 Christoph Kappel
h2.  Where is the output window of flash in fullscreen?
1205 3 Christoph Kappel
1206 2 Christoph Kappel
For flash, browsers seem to use window instance and class names that doesn't match the browser values. Therefore the windows will usually appear on the default view.
1207 1 Christoph Kappel
1208 2 Christoph Kappel
Following names are currently in use:
1209 1 Christoph Kappel
1210 2 Christoph Kappel
|_. Browser       |_. Arch   |_. WM_NAME            |_. WM_CLASS                                 |
1211 2 Christoph Kappel
| Firefox         | x86      | <unknown>            | "<unknown>", "<unknown>"                   |
1212 1 Christoph Kappel
| Chromium        | x86      | exe                  | "exe", "Exe"                               |
1213 2 Christoph Kappel
| Opera           | x86      | "operapluginwrapper" | "operapluginwrapper", "Operapluginwrapper" |
1214 1 Christoph Kappel
| nspluginwrapper | x86_64   | "npviewer.bin"       | "Npviewer.bin"                             |
1215 2 Christoph Kappel
1216 1 Christoph Kappel
The easiest way to avoid that is to add a [[tagging|tag]] that makes these windows sticky:
1217 2 Christoph Kappel
1218 1 Christoph Kappel
<pre>{{hide}}<code class="ruby">tag "flash" do
1219 2 Christoph Kappel
  match "<unknown>|exe|operapluginwrapper"
1220 2 Christoph Kappel
  stick true
1221 2 Christoph Kappel
end</code></pre>
1222 2 Christoph Kappel
1223 3 Christoph Kappel
h2.  Where is the output window of flash in fullscreen?
1224 3 Christoph Kappel
1225 2 Christoph Kappel
For flash, browsers seem to use window instance and class names that doesn't match the browser values. Therefore the windows will usually appear on the default view.
1226 1 Christoph Kappel
1227 2 Christoph Kappel
Following names are currently in use:
1228 1 Christoph Kappel
1229 2 Christoph Kappel
|_. Browser       |_. Arch   |_. WM_NAME            |_. WM_CLASS                                 |
1230 1 Christoph Kappel
| Firefox         | x86      | <unknown>            | "<unknown>", "<unknown>"                   |
1231 2 Christoph Kappel
| Chromium        | x86      | exe                  | "exe", "Exe"                               |
1232 1 Christoph Kappel
| Opera           | x86      | "operapluginwrapper" | "operapluginwrapper", "Operapluginwrapper" |
1233 1 Christoph Kappel
| nspluginwrapper | x86_64   | "npviewer.bin"       | "Npviewer.bin"                             |
1234 2 Christoph Kappel
1235 2 Christoph Kappel
The easiest way to avoid that is to add a [[tagging|tag]] that makes these windows sticky:
1236 2 Christoph Kappel
1237 2 Christoph Kappel
<pre>{{hide}}<code class="ruby">tag "flash" do
1238 2 Christoph Kappel
  match "<unknown>|exe|operapluginwrapper|npviewer.bin"
1239 2 Christoph Kappel
  stick true
1240 2 Christoph Kappel
end</code></pre>
1241 1 Christoph Kappel
1242 3 Christoph Kappel
h2.  What is required for the volume sublet?
1243 3 Christoph Kappel
1244 2 Christoph Kappel
The volume [[sublets|sublet]] uses @/dev/mixer@ to set/get the volume levels, which is an older interface introduced with "OSS":http://www.opensound.com/ and still available via "ALSA OSS emulation":http://www.alsa-project.org/. Apparently, newer kernels refuse to autoload that module anymore and you need to load it manually or via any init file.
1245 2 Christoph Kappel
1246 1 Christoph Kappel
{{info(Please check to the docs of your distribution how to do it.)}}
1247 2 Christoph Kappel
1248 1 Christoph Kappel
<pre><code>modprobe snd_mixer_oss</code></pre>
1249 2 Christoph Kappel
1250 2 Christoph Kappel
{{warn(Following explanation is technical!)}}
1251 2 Christoph Kappel
1252 2 Christoph Kappel
The [[sublets|sublet]] needs a way to access a mixer without any asynchronous callbacks. The reason for that is that [[subtle]] is single-threaded and can't use a dedicated thread to wait for the reply, but the APIs of "ALSA":http://www.alsa-project.org/ and "PulseAudio":http://pulseaudio.org are both designed to be asynchronous. Normally event drivven is fine but it is troublesome when you can't use their mainloop.
1253 2 Christoph Kappel
1254 2 Christoph Kappel
Since there is no way to add e.g. a control socket to the event main loop of [[subtle]], the @/dev/mixer@ approach is the only way and works for all sound systems.
1255 2 Christoph Kappel
1256 3 Christoph Kappel
h2.  How do I move program xyz to view abc?
1257 3 Christoph Kappel
1258 2 Christoph Kappel
Placement in [[subtle]] is +strict+ and completely done via [[tagging]]. There are many ways to change [[tagging|tags]] per runtime, common is to use either [[subtler]] or [[subtlext]].
1259 2 Christoph Kappel
1260 3 Christoph Kappel
h2.  subtler
1261 2 Christoph Kappel
1262 3 Christoph Kappel
1263 2 Christoph Kappel
[[subtler]] can be used on the commandline:
1264 2 Christoph Kappel
1265 2 Christoph Kappel
<pre>{{hide}}<code class="ruby">
1266 2 Christoph Kappel
subtler -ta tag         #< Add new tag 'tag'
1267 2 Christoph Kappel
subtler -cT client tag  #< Tag client 'client' with tag 'tag'
1268 2 Christoph Kappel
subtler -vT view tag    #< Tag view 'view' with tag 'tag'
1269 2 Christoph Kappel
</code></pre>
1270 2 Christoph Kappel
1271 3 Christoph Kappel
h2.  subtlext
1272 2 Christoph Kappel
1273 3 Christoph Kappel
1274 2 Christoph Kappel
[[subtlext]] requires basic "ruby":http://ruby-lang.org knowledge:
1275 2 Christoph Kappel
1276 2 Christoph Kappel
<pre>{{hide}}<code class="ruby">require "subtle/subtlext"
1277 2 Christoph Kappel
1278 2 Christoph Kappel
tag = Subtlext::Tag.new("tag").save  #< Add new tag 'tag'
1279 2 Christoph Kappel
Subtlext::Client["client"] + "tag"   #< Tag client 'client' with tag 'tag'
1280 2 Christoph Kappel
Subtlext::View["view"] + "tag"       #< Tag view 'view' with tag 'tag'
1281 1 Christoph Kappel
</code></pre>
1282 1 Christoph Kappel
1283 3 Christoph Kappel
h2.  Snippets
1284 1 Christoph Kappel
1285 3 Christoph Kappel
1286 1 Christoph Kappel
The [[snippets]] wiki page includes examples how to [[snippets#Move-windows|move to another view]].
1287 2 Christoph Kappel
1288 3 Christoph Kappel
h2.  Contrib
1289 2 Christoph Kappel
1290 3 Christoph Kappel
1291 2 Christoph Kappel
h3. Vitag
1292 2 Christoph Kappel
1293 2 Christoph Kappel
"subtle-contrib":http://subforge.org/projects/subtle-contrib/wiki contains [[subtle-contrib:vitag|vitag]] a script to change the [[tagging|tags]] of windows and views with an editor.
1294 2 Christoph Kappel
1295 1 Christoph Kappel
h3. Launcher
1296 1 Christoph Kappel
1297 2 Christoph Kappel
The "launcher":http://subforge.org/projects/subtle-contrib/wiki#Launcher uses quite the opposite way, instead of moving a window to a certain screen it just provides a way to launch a window directly on the right view with the correct [[tagging|tags]].
1298 1 Christoph Kappel
1299 3 Christoph Kappel
h2.  Stick
1300 1 Christoph Kappel
1301 3 Christoph Kappel
1302 1 Christoph Kappel
Most of the time, setting the window to *stick* does the trick too. Stick just displays the window on all views until the mode is disabled again. This can be done with [[grabs]] (default keys: *W-s*) or with [[subtler]]. (click on the window: @subtler -cXS@)
1303 1 Christoph Kappel
1304 1 Christoph Kappel
1305 2 Christoph Kappel
1306 3 Christoph Kappel
h2.  Where does sur store sublets and icons?
1307 3 Christoph Kappel
1308 2 Christoph Kappel
[[sur]] follows the "XDG Base Directory specifications":http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html to store data, which includes some base path for specific data types.
1309 1 Christoph Kappel
1310 1 Christoph Kappel
Following paths are used:
1311 2 Christoph Kappel
1312 2 Christoph Kappel
|_. Type  |_. XDG path                    |_. Default path                |
1313 1 Christoph Kappel
| Sublets | @$XDG_DATA_HOME/subtle/sublets@ | @~/.local/share/subtle/sublets@ |
1314 1 Christoph Kappel
| Icons   | @$XDG_DATA_HOME/subtle(icons@   | @~/.local/share/subtle/icons@   |
1315 1 Christoph Kappel
1316 3 Christoph Kappel
h2.  Why does program XYZ appears/turns as/to a gray canvas?
1317 3 Christoph Kappel
1318 2 Christoph Kappel
Generally, this happens, when a program needs a specific aspect ratio and [[subtle]] sets a gravity that violates this. Windows can tell the window manager about this kind of preferences via their size hints and [[subtle]] can honor those.
1319 1 Christoph Kappel
1320 1 Christoph Kappel
There are two possible ways:
1321 2 Christoph Kappel
1322 1 Christoph Kappel
# Enable size hints globally with the _&#58;resize_ option
1323 2 Christoph Kappel
  <pre>{{hide}}<code class="ruby">set :resize, true</code></pre>
1324 1 Christoph Kappel
# Enable this per program via [[tagging|tag]]
1325 2 Christoph Kappel
  <pre>{{hide}}<code class="ruby">tag "name" do
1326 2 Christoph Kappel
  match  "name"
1327 2 Christoph Kappel
  resize true
1328 2 Christoph Kappel
end</code></pre>
1329 2 Christoph Kappel
1330 2 Christoph Kappel
bq. Note: This can happen with "Java":http://java.com too, see "here":http://subforge.org/ezfaq/show/subtle?faq_id=14 for more information.
1331 2 Christoph Kappel
1332 3 Christoph Kappel
h2.  How can I use subtle without numpad?
1333 3 Christoph Kappel
1334 1 Christoph Kappel
Per default [[subtle]] uses the numpad, because it's easier to remind the different postions when you can see them. Generally this is just a suggestion, it's up to you to change the grabs to your needs - any keys will work. 
1335 2 Christoph Kappel
1336 1 Christoph Kappel
Keys that also have proven to work well are *q-w-e*, *a-s-d* and *y-x-c*:
1337 2 Christoph Kappel
1338 2 Christoph Kappel
<pre>{{hide}}<code class="ruby">grab "W-q", [ :top_left,     :top_left66,     :top_left33     ]
1339 2 Christoph Kappel
grab "W-w", [ :top,          :top66,          :top33          ]
1340 2 Christoph Kappel
grab "W-e", [ :top_right,    :top_right66,    :top_right33    ]
1341 2 Christoph Kappel
grab "W-a", [ :left,         :left66,         :left33         ]
1342 2 Christoph Kappel
grab "W-s", [ :center,       :center66,       :center33       ]
1343 1 Christoph Kappel
grab "W-d", [ :right,        :right66,        :right33        ]
1344 2 Christoph Kappel
1345 1 Christoph Kappel
# QWERTZ
1346 2 Christoph Kappel
grab "W-y", [ :bottom_left,  :bottom_left66,  :bottom_left33  ]
1347 1 Christoph Kappel
1348 2 Christoph Kappel
# QWERTY
1349 1 Christoph Kappel
grab "W-z", [ :bottom_left,  :bottom_left66,  :bottom_left33  ]
1350 2 Christoph Kappel
1351 2 Christoph Kappel
grab "W-x", [ :bottom,       :bottom66,       :bottom33       ]
1352 2 Christoph Kappel
grab "W-c", [ :bottom_right, :bottom_right66, :bottom_right33 ]
1353 2 Christoph Kappel
</code></pre>
1354 2 Christoph Kappel
1355 2 Christoph Kappel
1356 2 Christoph Kappel
You can find more about assigning keys [[Grabs|here]].
1357 1 Christoph Kappel
1358 3 Christoph Kappel
h2.  What is the difference between ViewSwitch and ViewJump?
1359 3 Christoph Kappel
1360 2 Christoph Kappel
Boths keys change the [[view]] of the current active [[screens|screen]], but the behavior how they do that depends on if the system consists either of a single [[screens|screen]] or more.
1361 2 Christoph Kappel
1362 3 Christoph Kappel
h2.  Single screen
1363 1 Christoph Kappel
1364 3 Christoph Kappel
1365 1 Christoph Kappel
Here both [[grabs]] do +exactly+ the same.
1366 2 Christoph Kappel
1367 3 Christoph Kappel
h2.  Multi screen
1368 2 Christoph Kappel
1369 3 Christoph Kappel
1370 2 Christoph Kappel
Here the behavior depends of the select [[views|view]] is visible on another screen or not.
1371 2 Christoph Kappel
1372 2 Christoph Kappel
* *ViewSwitch* either swaps the current [[views|view]] with the selected if it is visible on another [[screens|screen]] or just sets the selected [[views|view]] on current [[screens|screen]].
1373 2 Christoph Kappel
* *ViewJump* either focus the selected [[views|view]] if it is visible on another screen or just sets the select view on current [[screens|screen]].
1374 2 Christoph Kappel
1375 3 Christoph Kappel
h2.  What is the difference between ViewSwitch and ViewJump?
1376 3 Christoph Kappel
1377 2 Christoph Kappel
Boths keys change the [[view]] of the current active [[screens|screen]], but the behavior how they do that depends on if the system consists either of a single [[screens|screen]] or more.
1378 2 Christoph Kappel
1379 3 Christoph Kappel
h2.  Single screen
1380 2 Christoph Kappel
1381 3 Christoph Kappel
1382 2 Christoph Kappel
Here both [[grabs]] do +exactly+ the same.
1383 2 Christoph Kappel
1384 3 Christoph Kappel
h2.  Multi screen
1385 1 Christoph Kappel
1386 3 Christoph Kappel
1387 2 Christoph Kappel
Here the behavior depends on if the selected [[views|view]] is visible on another [[screens|screen]] or not.
1388 2 Christoph Kappel
1389 2 Christoph Kappel
* *ViewSwitch* either swaps the current [[views|view]] with the selected if it is visible on another [[screens|screen]] or just sets the selected [[views|view]] on current [[screens|screen]].
1390 2 Christoph Kappel
* *ViewJump* either focus the selected [[views|view]] if it is visible on another [[screens|screen]] or just sets the select [[views|view]] on current [[screens|screen]].
1391 2 Christoph Kappel
1392 3 Christoph Kappel
h2.  Why does subtle cause to many wakeups?
1393 3 Christoph Kappel
1394 1 Christoph Kappel
The wakeups are caused by a "Ruby":http://ruby-lang.org internal polling thread that runs every 10ms to schedule/handle other threads and signals. There is currently no way to avoid that in "YARV":http://www.atdot.net/yarv/, although the problem is well known.
1395 2 Christoph Kappel
1396 2 Christoph Kappel
http://www.ruby-forum.com/topic/200147
1397 1 Christoph Kappel
1398 3 Christoph Kappel
h2.  How do I tag gimp?
1399 3 Christoph Kappel
1400 2 Christoph Kappel
[[Tagging]] "GIMP":http://gimp.org can be nasty, because the current version (2.6) uses inconsistent window names and roles. The window roles are fixed in the current development snapshot and will hopefully find their way into the 2.8 release.
1401 2 Christoph Kappel
1402 1 Christoph Kappel
https://bugzilla.gnome.org/show_bug.cgi?id=645456
1403 2 Christoph Kappel
1404 3 Christoph Kappel
h2.  How do I move a program to another view?
1405 3 Christoph Kappel
1406 2 Christoph Kappel
Placement in [[subtle]] is +strict+ and completely done via [[tagging]]. There are many ways to change [[tagging|tags]] per runtime, common is to use either [[subtler]] or [[subtlext]].
1407 2 Christoph Kappel
1408 3 Christoph Kappel
h2.  subtler
1409 2 Christoph Kappel
1410 3 Christoph Kappel
1411 1 Christoph Kappel
[[subtler]] can be used on the commandline:
1412 2 Christoph Kappel
1413 2 Christoph Kappel
<pre>{{hide}}<code class="ruby">
1414 2 Christoph Kappel
subtler -ta tag         #< Add new tag 'tag'
1415 2 Christoph Kappel
subtler -cT client tag  #< Tag client 'client' with tag 'tag'
1416 2 Christoph Kappel
subtler -vT view tag    #< Tag view 'view' with tag 'tag'
1417 2 Christoph Kappel
</code></pre>
1418 2 Christoph Kappel
1419 3 Christoph Kappel
h2.  subtlext
1420 2 Christoph Kappel
1421 3 Christoph Kappel
1422 2 Christoph Kappel
[[subtlext]] requires basic "ruby":http://ruby-lang.org knowledge:
1423 2 Christoph Kappel
1424 2 Christoph Kappel
<pre>{{hide}}<code class="ruby">require "subtle/subtlext"
1425 2 Christoph Kappel
1426 2 Christoph Kappel
tag = Subtlext::Tag.new("tag").save  #< Add new tag 'tag'
1427 2 Christoph Kappel
Subtlext::Client["client"] + "tag"   #< Tag client 'client' with tag 'tag'
1428 2 Christoph Kappel
Subtlext::View["view"] + "tag"       #< Tag view 'view' with tag 'tag'
1429 2 Christoph Kappel
</code></pre>
1430 2 Christoph Kappel
1431 3 Christoph Kappel
h2.  Snippets
1432 2 Christoph Kappel
1433 3 Christoph Kappel
1434 2 Christoph Kappel
The [[snippets]] wiki page includes examples how to [[snippets#Move-windows|move to another view]].
1435 2 Christoph Kappel
1436 3 Christoph Kappel
h2.  Contrib
1437 2 Christoph Kappel
1438 3 Christoph Kappel
1439 1 Christoph Kappel
h3. Vitag
1440 1 Christoph Kappel
1441 2 Christoph Kappel
"subtle-contrib":http://subforge.org/projects/subtle-contrib/wiki contains [[subtle-contrib:vitag|vitag]] a script to change the [[tagging|tags]] of windows and views with an editor.
1442 2 Christoph Kappel
1443 2 Christoph Kappel
h3. Launcher
1444 2 Christoph Kappel
1445 2 Christoph Kappel
The "launcher":http://subforge.org/projects/subtle-contrib/wiki#Launcher uses quite the opposite way, instead of moving a window to a certain screen it just provides a way to launch a window directly on the right view with the correct [[tagging|tags]].
1446 2 Christoph Kappel
1447 3 Christoph Kappel
h2.  Stick
1448 1 Christoph Kappel
1449 3 Christoph Kappel
1450 1 Christoph Kappel
Most of the time, setting the window to *stick* does the trick too. Stick just displays the window on all views until the mode is disabled again. This can be done with [[grabs]] (default keys: *W-s*) or with [[subtler]]. (click on the window: @subtler -cXS@)
1451 2 Christoph Kappel
1452 2 Christoph Kappel
1453 2 Christoph Kappel
1454 3 Christoph Kappel
h2.  How do I start a program?
1455 3 Christoph Kappel
1456 2 Christoph Kappel
There are several way how to start a certain programm, here are the most common:
1457 2 Christoph Kappel
1458 2 Christoph Kappel
* Start your program via your $HOME/.xinitrc:
1459 2 Christoph Kappel
1460 2 Christoph Kappel
<pre><code class="ruby">
1461 2 Christoph Kappel
subtle &
1462 2 Christoph Kappel
PID=$!
1463 2 Christoph Kappel
sleep 2
1464 2 Christoph Kappel
urxvt
1465 2 Christoph Kappel
wait $PID
1466 2 Christoph Kappel
</code></pre>
1467 2 Christoph Kappel
1468 1 Christoph Kappel
* Start your program via [[grabs]]:
1469 1 Christoph Kappel
1470 1 Christoph Kappel
<pre><code class="ruby">
1471 2 Christoph Kappel
"A-x" => "urxvt"
1472 1 Christoph Kappel
</code></pre>
1473 2 Christoph Kappel
1474 2 Christoph Kappel
There are many launchers available like "dmenu":http://tools.suckless.org/dmenu and there is even a launcher especially designed for [[subtle]], you can find it in [[subtle-contrib:Launcher|here]].
1475 2 Christoph Kappel
1476 2 Christoph Kappel
1477 3 Christoph Kappel
h2.  How do I tag console based programs?
1478 3 Christoph Kappel
1479 2 Christoph Kappel
When console based programs like "irssi":http://irssi.org are started with a terminal like @urxvt -e irssi@, they usually just change the *WM_NAME* of the terminal and per default, [[subtle]] just uses both of the {{color(#ff0000, WM_CLASS)}} values for tagging.
1480 2 Christoph Kappel
1481 2 Christoph Kappel
The problem about that is, that the [[tagging]] is normally done before the terminal really starts the desired app. To avoid that all better known terminals support the *-name* argument which changes the instance value (first string) of the *WM_CLASS*: @urxvt -name irssi -e irssi@
1482 2 Christoph Kappel
1483 2 Christoph Kappel
Another problem is that terminals retain their class value (second string) of the {{color(#ff0000, WM_CLASS)}} and may match other [[tagging|tags]].
1484 2 Christoph Kappel
1485 2 Christoph Kappel
The common solution to bypass is this to use the :instance matcher, which just matches when for the specific instance value. 
1486 2 Christoph Kappel
1487 2 Christoph Kappel
Following table shows the *WM_NAME* and *WM_CLASS* output of "xprop":http://www.xfree86.org/current/xprop.1.html of the various combinations:
1488 2 Christoph Kappel
1489 2 Christoph Kappel
|_. Command                  |_. WM_NAME    |_. WM_CLASS   |
1490 2 Christoph Kappel
| urxvt                      | urxvt        | urxvt, URxvt |
1491 2 Christoph Kappel
| urxvt -e irssi             | irssi        | urxvt, URxvt |
1492 1 Christoph Kappel
| urxvt -name irssi          | urxvt        | irssi, URxvt |
1493 2 Christoph Kappel
| urxvt -name irssi -e irssi | irssi        | irssi, URxvt |
1494 2 Christoph Kappel
1495 2 Christoph Kappel
So the easiest way to reliable match this client is a [[lagging|tag]] like this:
1496 2 Christoph Kappel
1497 1 Christoph Kappel
<pre>code class="ruby">tag "irssi" do
1498 1 Christoph Kappel
  match :instance => "irssi"
1499 2 Christoph Kappel
end</code></pre>
1500 2 Christoph Kappel
1501 2 Christoph Kappel
1502 2 Christoph Kappel
1503 3 Christoph Kappel
h2.  How do I tag console based programs?
1504 3 Christoph Kappel
1505 2 Christoph Kappel
When console based programs like "irssi":http://irssi.org are started with a terminal like @urxvt -e irssi@, they usually just change the *WM_NAME* of the terminal and per default, [[subtle]] just uses both of the *WM_CLASS* values for tagging.
1506 2 Christoph Kappel
1507 2 Christoph Kappel
The problem about that is, that the [[tagging]] is normally done before the terminal really starts the desired app. To avoid that all better known terminals support the *-name* argument which changes the instance value (first string) of the *WM_CLASS*: @urxvt -name irssi -e irssi@
1508 1 Christoph Kappel
1509 1 Christoph Kappel
Another problem is that terminals retain their class value (second string) of the *WM_CLASS* and may match other [[tagging|tags]] like:
1510 2 Christoph Kappel
1511 2 Christoph Kappel
<pre><code class="ruby">tag "terms" do
1512 2 Christoph Kappel
  match "urxvt"
1513 2 Christoph Kappel
end</code></pre>
1514 2 Christoph Kappel
1515 2 Christoph Kappel
The common solution to bypass is this to use the :instance matcher, which just matches when for the specific instance value. 
1516 2 Christoph Kappel
1517 2 Christoph Kappel
Following table shows the *WM_NAME* and *WM_CLASS* output of "xprop":http://www.xfree86.org/current/xprop.1.html of the various combinations:
1518 2 Christoph Kappel
1519 2 Christoph Kappel
|_. Command                  |_. WM_NAME    |_. WM_CLASS   |
1520 2 Christoph Kappel
| urxvt                      | urxvt        | urxvt, URxvt |
1521 1 Christoph Kappel
| urxvt -e irssi             | irssi        | urxvt, URxvt |
1522 1 Christoph Kappel
| urxvt -name irssi          | urxvt        | irssi, URxvt |
1523 2 Christoph Kappel
| urxvt -name irssi -e irssi | irssi        | irssi, URxvt |
1524 1 Christoph Kappel
1525 1 Christoph Kappel
So the easiest way to reliable match this client is a [[lagging|tag]] like this:
1526 2 Christoph Kappel
1527 2 Christoph Kappel
<pre><code class="ruby">tag "irssi" do
1528 2 Christoph Kappel
  match :instance => "irssi"
1529 2 Christoph Kappel
end</code></pre>
1530 2 Christoph Kappel
1531 2 Christoph Kappel
1532 2 Christoph Kappel
1533 3 Christoph Kappel
h2.  How do I tag console based programs?
1534 3 Christoph Kappel
1535 1 Christoph Kappel
When console based programs like "irssi":http://irssi.org are started with a terminal like @urxvt -e irssi@, they usually just change the *WM_NAME* of the terminal and per default, [[subtle]] just uses both of the *WM_CLASS* values for tagging.
1536 2 Christoph Kappel
1537 2 Christoph Kappel
The problem about that is, that the [[tagging]] is normally done before the terminal really starts the desired app. To avoid that all better known terminals support the *-name* argument which changes the instance value (first string) of the *WM_CLASS*: @urxvt -name irssi -e irssi@
1538 2 Christoph Kappel
1539 2 Christoph Kappel
Another problem is that terminals retain their class value (second string) of the *WM_CLASS* and may match other [[tagging|tags]] like:
1540 2 Christoph Kappel
1541 2 Christoph Kappel
<pre><code class="ruby">tag "terms" do
1542 2 Christoph Kappel
  match "urxvt"
1543 2 Christoph Kappel
end</code></pre>
1544 2 Christoph Kappel
1545 2 Christoph Kappel
The common solution to bypass is this to use the :instance matcher, which just matches when for the specific instance value. So the easiest way to reliable match this client is a [[tagging|tag]] like this:
1546 2 Christoph Kappel
1547 2 Christoph Kappel
<pre><code class="ruby">tag "irssi" do
1548 2 Christoph Kappel
  match :instance => "irssi"
1549 2 Christoph Kappel
end</code></pre>
1550 2 Christoph Kappel
1551 2 Christoph Kappel
Following table shows the *WM_NAME* and *WM_CLASS* output of "xprop":http://www.xfree86.org/current/xprop.1.html of the various combinations:
1552 1 Christoph Kappel
1553 1 Christoph Kappel
|_. Command                  |_. WM_NAME    |_. WM_CLASS   |
1554 2 Christoph Kappel
| urxvt                      | urxvt        | urxvt, URxvt |
1555 2 Christoph Kappel
| urxvt -e irssi             | irssi        | urxvt, URxvt |
1556 2 Christoph Kappel
| urxvt -name irssi          | urxvt        | irssi, URxvt |
1557 2 Christoph Kappel
| urxvt -name irssi -e irssi | irssi        | irssi, URxvt |
1558 2 Christoph Kappel
1559 2 Christoph Kappel
1560 2 Christoph Kappel
1561 2 Christoph Kappel
1562 2 Christoph Kappel
1563 3 Christoph Kappel
h2.  How do I tag console based programs?
1564 3 Christoph Kappel
1565 1 Christoph Kappel
When console based programs like "irssi":http://irssi.org are started with a terminal like @urxvt -e irssi@, they usually just change the *WM_NAME* of the terminal and per default, [[subtle]] uses both of the *WM_CLASS* values for tagging.
1566 2 Christoph Kappel
1567 2 Christoph Kappel
The problem about that is, that the [[tagging]] is normally done before the terminal really starts the desired app. To avoid that all better known terminals support the *-name* argument which changes the instance value (first string) of the *WM_CLASS*: @urxvt -name irssi -e irssi@
1568 2 Christoph Kappel
1569 2 Christoph Kappel
Another problem is that terminals retain their class value (second string) of the *WM_CLASS* and may match other [[tagging|tags]] like:
1570 2 Christoph Kappel
1571 1 Christoph Kappel
<pre><code class="ruby">tag "terms" do
1572 1 Christoph Kappel
  match "urxvt"
1573 2 Christoph Kappel
end</code></pre>
1574 2 Christoph Kappel
1575 2 Christoph Kappel
The common solution to bypass is this to use the :instance matcher, which just matches when for the specific instance value. So the easiest way to reliable match this client is a [[tagging|tag]] like this:
1576 2 Christoph Kappel
1577 2 Christoph Kappel
<pre><code class="ruby">tag "irssi" do
1578 1 Christoph Kappel
  match :instance => "irssi"
1579 1 Christoph Kappel
end</code></pre>
1580 2 Christoph Kappel
1581 2 Christoph Kappel
Following table shows the *WM_NAME* and *WM_CLASS* output of "xprop":http://www.xfree86.org/current/xprop.1.html of the various combinations:
1582 1 Christoph Kappel
1583 2 Christoph Kappel
|_. Command                  |_. WM_NAME    |_. WM_CLASS   |
1584 1 Christoph Kappel
| urxvt                      | urxvt        | urxvt, URxvt |
1585 2 Christoph Kappel
| urxvt -e irssi             | irssi        | urxvt, URxvt |
1586 2 Christoph Kappel
| urxvt -name irssi          | urxvt        | irssi, URxvt |
1587 2 Christoph Kappel
| urxvt -name irssi -e irssi | irssi        | irssi, URxvt |
1588 2 Christoph Kappel
1589 2 Christoph Kappel
1590 2 Christoph Kappel
1591 2 Christoph Kappel
1592 2 Christoph Kappel
1593 3 Christoph Kappel
h2.  Why did the volume sublet stop working after kernel update?
1594 3 Christoph Kappel
1595 1 Christoph Kappel
The volume [[sublets|sublet]] uses @/dev/mixer@ to set/get the volume levels, which is an older interface introduced with "OSS":http://www.opensound.com/ and still available via "ALSA OSS emulation":http://www.alsa-project.org/. Apparently, newer kernels refuse to autoload that module anymore and you need to load it manually or via any init file.
1596 2 Christoph Kappel
1597 1 Christoph Kappel
{{info(Please check to the docs of your distribution how to do it.)}}
1598 1 Christoph Kappel
1599 2 Christoph Kappel
{{warn(Following explanation is technical!)}}
1600 2 Christoph Kappel
1601 2 Christoph Kappel
The [[sublets|sublet]] needs a way to access a mixer without any asynchronous callbacks. The reason for that is that [[subtle]] is single-threaded and can't use a dedicated thread to wait for the reply, but the APIs of "ALSA":http://www.alsa-project.org/ and "PulseAudio":http://pulseaudio.org are both designed to be asynchronous. Normally event drivven is fine but it is troublesome when you can't use their mainloop.
1602 2 Christoph Kappel
1603 2 Christoph Kappel
Since there is no way to add e.g. a control socket to the event main loop of [[subtle]], the @/dev/mixer@ approach is the only way and works for all sound systems.
1604 2 Christoph Kappel
1605 3 Christoph Kappel
h2.  Why did the volume sublet stop working after kernel update?
1606 3 Christoph Kappel
1607 1 Christoph Kappel
The volume [[sublets|sublet]] uses @/dev/mixer@ to set/get the volume levels, which is an older interface introduced with "OSS":http://www.opensound.com/ and still available via "ALSA OSS emulation":http://www.alsa-project.org/. Apparently, newer kernels refuse to autoload that module anymore and you need to load it manually or via any init file.
1608 2 Christoph Kappel
1609 2 Christoph Kappel
{{info(Please check to the docs of your distribution how to do it.)}}
1610 2 Christoph Kappel
1611 2 Christoph Kappel
<pre><code>modprobe snd_mixer_oss</code></pre>
1612 2 Christoph Kappel
1613 2 Christoph Kappel
{{warn(Following explanation is technical!)}}
1614 2 Christoph Kappel
1615 2 Christoph Kappel
The [[sublets|sublet]] needs a way to access a mixer without any asynchronous callbacks. The reason for that is that [[subtle]] is single-threaded and can't use a dedicated thread to wait for the reply, but the APIs of "ALSA":http://www.alsa-project.org/ and "PulseAudio":http://pulseaudio.org are both designed to be asynchronous. Normally event drivven is fine but it is troublesome when you can't use their mainloop.
1616 2 Christoph Kappel
1617 1 Christoph Kappel
Since there is no way to add e.g. a control socket to the event main loop of [[subtle]], the @/dev/mixer@ approach is the only way and works for all sound systems.
1618 2 Christoph Kappel
1619 3 Christoph Kappel
h2.  Is subtle a reparenting window manager?
1620 3 Christoph Kappel
1621 1 Christoph Kappel
*Nope*, [[subtle]] doesn't reparent windows and there is in fact *no* reason to do that. The layout in [[subtle]] is a really loose set, the only relation between a [[views|view]] and a [[client]] is [[tagging]] and this is checked on every [[views|view]] update.
1622 2 Christoph Kappel
1623 2 Christoph Kappel
Reparenting windows would require following additional steps, when a window is visible on a certain [[views|view]]:
1624 2 Christoph Kappel
1625 2 Christoph Kappel
# Resize the [[views|view]] toplevel window to the size of the current [[screen]]
1626 2 Christoph Kappel
# Reparent the [[client]] window to the toplevel window
1627 2 Christoph Kappel
# Handle (ignore here) the generated expose and crossing events
1628 2 Christoph Kappel
1629 2 Christoph Kappel
Probably sounds like not much overhead, but keep in mind this is just required because the developer of "Java":http://www.java.com/ and "Qt":http://qt.nokia.com/products/ cannot understand following line from the "ICCCM":http://tronche.com/gui/x/icccm/sec-4.html#s-4.2.1:
1630 2 Christoph Kappel
1631 2 Christoph Kappel
bq. Clients must be aware that some window managers will reparent their top-level windows so that a window that was created as a child of the root will be displayed as a child of some window belonging to the window manager
1632 2 Christoph Kappel
1633 3 Christoph Kappel
h2.  How do I tag console based programs?
1634 3 Christoph Kappel
1635 2 Christoph Kappel
When console based programs like "irssi":http://irssi.org are started with a terminal like @urxvt -e irssi@, they usually just change the *WM_NAME* of the terminal and per default, [[subtle]] uses both of the *WM_CLASS* values for tagging.
1636 2 Christoph Kappel
1637 2 Christoph Kappel
The problem about that is, that the [[tagging]] is normally done before the terminal really starts the desired app. To avoid that all better known terminals support the *-name* argument which changes the instance value (first string) of the *WM_CLASS*: @urxvt -name irssi -e irssi@
1638 2 Christoph Kappel
1639 2 Christoph Kappel
Another problem is that terminals retain their class value (second string) of the *WM_CLASS* and may match other [[tagging|tags]] like:
1640 2 Christoph Kappel
1641 1 Christoph Kappel
<pre><code class="ruby">tag "terms" do
1642 1 Christoph Kappel
  match "urxvt"
1643 2 Christoph Kappel
end</code></pre>
1644 2 Christoph Kappel
1645 2 Christoph Kappel
The common solution to bypass is this to use the :instance matcher, which just matches when for the specific instance value. So the easiest way to reliable match this client is a [[tagging|tag]] like this:
1646 2 Christoph Kappel
1647 2 Christoph Kappel
<pre><code class="ruby">tag "irssi" do
1648 2 Christoph Kappel
  match :instance => "irssi"
1649 1 Christoph Kappel
end</code></pre>
1650 2 Christoph Kappel
1651 1 Christoph Kappel
Following table shows the *WM_NAME* and *WM_CLASS* output of "xprop":http://www.xfree86.org/current/xprop.1.html of the various combinations:
1652 2 Christoph Kappel
1653 1 Christoph Kappel
|_. Command                  |_. WM_NAME    |_. WM_CLASS   |
1654 1 Christoph Kappel
| urxvt                      | urxvt        | urxvt, URxvt |
1655 2 Christoph Kappel
| urxvt -e irssi             | irssi        | urxvt, URxvt |
1656 2 Christoph Kappel
| urxvt -name irssi          | urxvt        | irssi, URxvt |
1657 2 Christoph Kappel
| urxvt -name irssi -e irssi | irssi        | irssi, URxvt |
1658 1 Christoph Kappel
1659 2 Christoph Kappel
Please have a look at the [[Tagging|tagging wiki page]] for more information.
1660 1 Christoph Kappel
1661 2 Christoph Kappel
1662 2 Christoph Kappel
1663 2 Christoph Kappel
1664 3 Christoph Kappel
h2.  Why does subtle cause to many wakeups?
1665 3 Christoph Kappel
1666 1 Christoph Kappel
The wakeups are caused by a "Ruby":http://ruby-lang.org internal polling thread that runs every 10ms to schedule/handle other threads and signals. There is currently no way to avoid that in "YARV":http://www.atdot.net/yarv/, although the problem is well known.
1667 1 Christoph Kappel
1668 2 Christoph Kappel
http://www.ruby-forum.com/topic/200147
1669 1 Christoph Kappel
1670 2 Christoph Kappel
There is finally some progress regarding this: http://www.ruby-forum.com/topic/549998
1671 2 Christoph Kappel
1672 3 Christoph Kappel
h2.  Why don't my grabs work with xyz keyboard layout?
1673 3 Christoph Kappel
1674 2 Christoph Kappel
Actually, I have no idea why setting the keyboard layout in your @xorg.conf@ isn't suffucient, but apparently you need to call *setxkbmap* in one of your startup files to set the keymap. My suggestion is to use the @~/.xinitrc@, because it is perfectly suited to setup Xorg and usually read.
1675 2 Christoph Kappel
1676 2 Christoph Kappel
Just add something like this to your @~/.xinitrc@ *before* you start [[subtle]]: 
1677 1 Christoph Kappel
1678 1 Christoph Kappel
<pre><code>setxkbmap -layout 'de(nodeadkeys)'</code></pre>
1679 2 Christoph Kappel
1680 3 Christoph Kappel
h2.  Where is the output window of flash in fullscreen?
1681 3 Christoph Kappel
1682 2 Christoph Kappel
For flash, browsers seem to use window instance and class names that doesn't match the browser values. Therefore the windows will usually appear on the default view.
1683 2 Christoph Kappel
1684 1 Christoph Kappel
Following names are currently in use:
1685 1 Christoph Kappel
1686 2 Christoph Kappel
|_. Browser       |_. Arch   |_. WM_NAME            |_. WM_CLASS                                 |
1687 1 Christoph Kappel
| Firefox <7.0.1  | all      | <unknown>            | "<unknown>", "<unknown>"                   |
1688 1 Christoph Kappel
| Firefox >=7.0.1 | all      | plugin-container     | "plugin-container", "Plugin-container"     |
1689 2 Christoph Kappel
| Chromium        | all      | exe                  | "exe", "Exe"                               |
1690 2 Christoph Kappel
| Opera           | x86      | "operapluginwrapper" | "operapluginwrapper", "Operapluginwrapper" |
1691 1 Christoph Kappel
| nspluginwrapper | x86_64   | "npviewer.bin"       | "Npviewer.bin"                             |
1692 2 Christoph Kappel
1693 1 Christoph Kappel
The easiest way to avoid that is to add a [[tagging|tag]] that makes these windows sticky:
1694 2 Christoph Kappel
1695 2 Christoph Kappel
<pre>{{hide}}<code class="ruby">tag "flash" do
1696 2 Christoph Kappel
  match "<unknown>|plugin-container|exe|operapluginwrapper|npviewer.bin"
1697 2 Christoph Kappel
  stick true
1698 2 Christoph Kappel
end</code></pre>
1699 2 Christoph Kappel
1700 3 Christoph Kappel
h2.  How do I (auto)start applications?
1701 3 Christoph Kappel
1702 2 Christoph Kappel
There are several way how to start a certain programm, here are the most common:
1703 2 Christoph Kappel
1704 2 Christoph Kappel
* Start your program via your $HOME/.xinitrc:
1705 2 Christoph Kappel
1706 2 Christoph Kappel
<pre><code class="ruby">
1707 2 Christoph Kappel
subtle &
1708 2 Christoph Kappel
PID=$!
1709 1 Christoph Kappel
sleep 2
1710 1 Christoph Kappel
urxvt
1711 2 Christoph Kappel
wait $PID
1712 2 Christoph Kappel
</code></pre>
1713 1 Christoph Kappel
1714 1 Christoph Kappel
* Start your program via [[grabs]]:
1715 1 Christoph Kappel
1716 2 Christoph Kappel
<pre><code class="ruby">
1717 1 Christoph Kappel
"A-x" => "urxvt"
1718 2 Christoph Kappel
</code></pre>
1719 2 Christoph Kappel
1720 2 Christoph Kappel
There are many launchers available like "dmenu":http://tools.suckless.org/dmenu and there is even a launcher especially designed for [[subtle]], you can find it in [[subtle-contrib:Launcher|here]].
1721 1 Christoph Kappel
1722 1 Christoph Kappel
1723 3 Christoph Kappel
h2.  How do I (auto)start programs?
1724 3 Christoph Kappel
1725 2 Christoph Kappel
There are several way how to start a certain programm, here are the most common:
1726 2 Christoph Kappel
1727 2 Christoph Kappel
* Start your program via your $HOME/.xinitrc:
1728 1 Christoph Kappel
1729 1 Christoph Kappel
<pre><code class="ruby">
1730 2 Christoph Kappel
subtle &
1731 2 Christoph Kappel
PID=$!
1732 2 Christoph Kappel
sleep 2
1733 2 Christoph Kappel
urxvt
1734 2 Christoph Kappel
wait $PID
1735 2 Christoph Kappel
</code></pre>
1736 2 Christoph Kappel
1737 2 Christoph Kappel
* Start your program via [[grabs]]:
1738 1 Christoph Kappel
1739 2 Christoph Kappel
<pre><code class="ruby">
1740 1 Christoph Kappel
"A-x" => "urxvt"
1741 1 Christoph Kappel
</code></pre>
1742 1 Christoph Kappel
1743 2 Christoph Kappel
There are many launchers available like "dmenu":http://tools.suckless.org/dmenu and there is even a launcher especially designed for [[subtle]], you can find it in [[subtle-contrib:Launcher|here]].
1744 2 Christoph Kappel
1745 2 Christoph Kappel
1746 3 Christoph Kappel
h2.  How to match a GLFW window
1747 3 Christoph Kappel
1748 2 Christoph Kappel
GLFW set the windows name after the window get created, so you can't match a particular GLFW window by his name.
1749 2 Christoph Kappel
1750 1 Christoph Kappel
to match any GLFW window :
1751 2 Christoph Kappel
1752 1 Christoph Kappel
<pre>
1753 1 Christoph Kappel
tag "glfw" do
1754 1 Christoph Kappel
\tmatch name: "GLFW.*"
1755 1 Christoph Kappel
\t# Your code....
1756 1 Christoph Kappel
end
1757 2 Christoph Kappel
</pre>
1758 2 Christoph Kappel
1759 3 Christoph Kappel
h2.  How to match a GLFW window
1760 3 Christoph Kappel
1761 2 Christoph Kappel
GLFW set the name of the window after the window get created, so you can't match a particular window by his name.
1762 2 Christoph Kappel
1763 2 Christoph Kappel
to match any GLFW window :
1764 1 Christoph Kappel
1765 1 Christoph Kappel
<pre>
1766 1 Christoph Kappel
tag "glfw" do
1767 2 Christoph Kappel
\tmatch name: "GLFW.*"
1768 1 Christoph Kappel
\t# your code
1769 2 Christoph Kappel
end
1770 2 Christoph Kappel
</pre>
1771 2 Christoph Kappel
1772 3 Christoph Kappel
h2.  How to match a GLFW window
1773 3 Christoph Kappel
1774 2 Christoph Kappel
GLFW set the name of the window after the window get created, so you can't match a particular window by his name.
1775 2 Christoph Kappel
1776 1 Christoph Kappel
to match any GLFW window :
1777 1 Christoph Kappel
1778 2 Christoph Kappel
<pre>
1779 2 Christoph Kappel
tag "glfw" do
1780 1 Christoph Kappel
\tmatch name: "GLFW.*"
1781 2 Christoph Kappel
\t# your code
1782 1 Christoph Kappel
end
1783 2 Christoph Kappel
</pre>
1784 2 Christoph Kappel
1785 3 Christoph Kappel
h2.  Why does subtle cause to many wakeups?
1786 3 Christoph Kappel
1787 2 Christoph Kappel
The wakeups are caused by a "Ruby":http://ruby-lang.org internal polling thread that runs every 10ms to schedule/handle other threads and signals. There is currently no way to avoid that in "YARV":http://www.atdot.net/yarv/, although the problem is well known.
1788 2 Christoph Kappel
1789 1 Christoph Kappel
http://www.ruby-forum.com/topic/200147
1790 1 Christoph Kappel
1791 1 Christoph Kappel
There is finally some progress regarding this: http://www.ruby-forum.com/topic/549998
1792 1 Christoph Kappel
1793 3 Christoph Kappel
h2.  Is there any log file?
1794 3 Christoph Kappel
1795 2 Christoph Kappel
Nope, there is *no* log file. In case you need one for e.g. reporting a bug +please+ read to the [[bugs|reporting a bug]] wiki page and check the paragraph about [[bugs#enable-logging|logging]].
1796 2 Christoph Kappel
1797 3 Christoph Kappel
h2.  How do I (auto)start programs?
1798 3 Christoph Kappel
1799 2 Christoph Kappel
There are several way how to start a certain programm, here are the most common:
1800 2 Christoph Kappel
1801 2 Christoph Kappel
* Start your program via your $HOME/.xinitrc:
1802 2 Christoph Kappel
1803 2 Christoph Kappel
<pre><code class="ruby">
1804 1 Christoph Kappel
subtle &
1805 1 Christoph Kappel
PID=$!
1806 2 Christoph Kappel
sleep 2
1807 1 Christoph Kappel
urxvt
1808 2 Christoph Kappel
wait $PID
1809 1 Christoph Kappel
</code></pre>
1810 2 Christoph Kappel
1811 1 Christoph Kappel
* Start your program via [[grabs]]:
1812 2 Christoph Kappel
1813 1 Christoph Kappel
<pre><code class="ruby">
1814 2 Christoph Kappel
"A-x" => "urxvt"
1815 2 Christoph Kappel
</code></pre>
1816 2 Christoph Kappel
1817 2 Christoph Kappel
There are many launchers available like "dmenu":http://tools.suckless.org/dmenu and there is even a launcher especially designed for [[subtle]], you can find it in [[subtle-contrib:Launcher|here]].
1818 1 Christoph Kappel
1819 1 Christoph Kappel
1820 3 Christoph Kappel
h2.  How do I tag gimp?
1821 3 Christoph Kappel
1822 1 Christoph Kappel
[[Tagging]] "GIMP":http://gimp.org can be nasty, because the current version (2.6) uses inconsistent window names and roles. The window roles are fixed in the current development snapshot and will hopefully find their way into the 2.8 release.
1823 2 Christoph Kappel
1824 1 Christoph Kappel
https://bugzilla.gnome.org/show_bug.cgi?id=645456
1825 2 Christoph Kappel
1826 3 Christoph Kappel
h2.  How do I set a wallpaper in subtle?
1827 3 Christoph Kappel
1828 2 Christoph Kappel
On start, [[subtle]] sets a background color (_if set_) to the root window and therefore *overwrites* any root pixmap set before. To avoid this, you just need to comment out the *&#58;background* line from your config.
1829 1 Christoph Kappel
1830 2 Christoph Kappel
[[subtle]] itself has no and will never have either an autostart or way to set a wallpaper directly. Normally you just want to setup your X session and and not [[subtle]]. Your _~/.xinitrc_ is the right place for stuff like this.
1831 2 Christoph Kappel
1832 2 Christoph Kappel
A background can easily set with a tool like "feh":http://linuxbrit.co.uk/software/feh/.
1833 1 Christoph Kappel
1834 3 Christoph Kappel
h2.  Why don't my grabs work with xyz keyboard layout?
1835 3 Christoph Kappel
1836 1 Christoph Kappel
Actually, I have no idea why setting the keyboard layout in your @xorg.conf@ isn't suffucient, but apparently you need to call *setxkbmap* in one of your startup files to set the keymap. My suggestion is to use the @~/.xinitrc@, because it is perfectly suited to setup Xorg and usually read.
1837 2 Christoph Kappel
1838 1 Christoph Kappel
Just add something like this to your @~/.xinitrc@ *before* you start [[subtle]]: 
1839 2 Christoph Kappel
1840 2 Christoph Kappel
<pre><code>setxkbmap -layout 'de(nodeadkeys)'</code></pre>
1841 2 Christoph Kappel
1842 3 Christoph Kappel
h2.  How to match a GLFW window
1843 3 Christoph Kappel
1844 2 Christoph Kappel
GLFW set the windows name after the window get created, so you can't match a particular GLFW window by his name.
1845 1 Christoph Kappel
1846 2 Christoph Kappel
to match any GLFW window :
1847 2 Christoph Kappel
1848 2 Christoph Kappel
<pre>
1849 2 Christoph Kappel
tag "glfw" do
1850 2 Christoph Kappel
\tmatch name: "GLFW.*"
1851 2 Christoph Kappel
\t# Your code....
1852 2 Christoph Kappel
end
1853 2 Christoph Kappel
</pre>
1854 2 Christoph Kappel
1855 3 Christoph Kappel
h2.  How to match a GLFW window
1856 3 Christoph Kappel
1857 1 Christoph Kappel
GLFW set the name of the window after the window get created, so you can't match a particular window by his name.
1858 1 Christoph Kappel
1859 1 Christoph Kappel
to match any GLFW window :
1860 2 Christoph Kappel
1861 2 Christoph Kappel
<pre>
1862 2 Christoph Kappel
tag "glfw" do
1863 2 Christoph Kappel
\tmatch name: "GLFW.*"
1864 2 Christoph Kappel
\t# your code
1865 2 Christoph Kappel
end
1866 2 Christoph Kappel
</pre>
1867 2 Christoph Kappel
1868 3 Christoph Kappel
h2.  How can I manually delete a sublet?
1869 3 Christoph Kappel
1870 1 Christoph Kappel
[[Sublets]] usually consist of a *&#42;.rb* file, a *&#42;.spec* file and one or more icons. All these files can be found in their respective folder in @$XDG_DATA_HOME/subtle@ resp. @~/.local/share/subtle@. After deleting the [[sublets|sublet]] files the cache of [[sur]] needs to be updated or otherwise [[sur]] will think the [[sublets|sublet]] is still installed: @sur update -l@
1871 1 Christoph Kappel
1872 3 Christoph Kappel
h2.  Where does sur store sublets and icons?
1873 3 Christoph Kappel
1874 1 Christoph Kappel
[[sur]] follows the "XDG Base Directory specifications":http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html to store data, which includes some base path for specific data types.
1875 2 Christoph Kappel
1876 2 Christoph Kappel
Following paths are used:
1877 2 Christoph Kappel
1878 2 Christoph Kappel
|_. Type  |_. XDG path                    |_. Default path                |
1879 2 Christoph Kappel
| Sublets | @$XDG_DATA_HOME/subtle/sublets@ | @~/.local/share/subtle/sublets@ |
1880 2 Christoph Kappel
| Icons   | @$XDG_DATA_HOME/subtle(icons@   | @~/.local/share/subtle/icons@   |
1881 1 Christoph Kappel
1882 3 Christoph Kappel
h2.  How to match a GLFW window
1883 3 Christoph Kappel
1884 2 Christoph Kappel
GLFW set the name of the window after the window get created, so you can't match a particular window by his name.
1885 2 Christoph Kappel
1886 2 Christoph Kappel
to match any GLFW window :
1887 1 Christoph Kappel
1888 1 Christoph Kappel
<pre>
1889 2 Christoph Kappel
tag "glfw" do
1890 2 Christoph Kappel
\tmatch name: "GLFW.*"
1891 2 Christoph Kappel
\t# your code
1892 2 Christoph Kappel
end
1893 2 Christoph Kappel
</pre>
1894 2 Christoph Kappel
1895 3 Christoph Kappel
h2.  How do I run a program on startup/autostart?
1896 3 Christoph Kappel
1897 1 Christoph Kappel
Let's say you want "urxvt":http://software.schmorp.de/pkg/rxvt-unicode.html to start after [[subtle]], and for some reason @echo "urxvt" >> ~/.xinitrc@ is just not cutting it. Using the *&#58;start* hook and [[subtlext]] we can simulate autostart like so:
1898 2 Christoph Kappel
1899 2 Christoph Kappel
<pre>{{hide}}<code class="ruby">
1900 2 Christoph Kappel
on :start do
1901 2 Christoph Kappel
  Subtlext::Subtle.spawn "urxvt"
1902 2 Christoph Kappel
end
1903 2 Christoph Kappel
</pre></code>
1904 1 Christoph Kappel
1905 3 Christoph Kappel
h2.  Where is the output window of flash in fullscreen?
1906 3 Christoph Kappel
1907 2 Christoph Kappel
For flash, browsers seem to use window instance and class names that doesn't match the browser values. Therefore the windows will usually appear on the default view.
1908 2 Christoph Kappel
1909 2 Christoph Kappel
Following names are currently in use:
1910 2 Christoph Kappel
1911 2 Christoph Kappel
|_. Browser       |_. Arch   |_. WM_NAME            |_. WM_CLASS                                 |
1912 1 Christoph Kappel
| Firefox <7.0.1  | all      | <unknown>            | "<unknown>", "<unknown>"                   |
1913 1 Christoph Kappel
| Firefox >=7.0.1 | all      | plugin-container     | "plugin-container", "Plugin-container"     |
1914 2 Christoph Kappel
| Chromium        | all      | exe                  | "exe", "Exe"                               |
1915 2 Christoph Kappel
| Opera           | x86      | "operapluginwrapper" | "operapluginwrapper", "Operapluginwrapper" |
1916 2 Christoph Kappel
| nspluginwrapper | x86_64   | "npviewer.bin"       | "Npviewer.bin"                             |
1917 2 Christoph Kappel
1918 2 Christoph Kappel
The easiest way to avoid that is to add a [[tagging|tag]] that makes these windows sticky:
1919 2 Christoph Kappel
1920 2 Christoph Kappel
<pre>{{hide}}<code class="ruby">tag "flash" do
1921 2 Christoph Kappel
  match "<unknown>|plugin-container|exe|operapluginwrapper|npviewer.bin"
1922 2 Christoph Kappel
  stick true
1923 2 Christoph Kappel
end</code></pre>
1924 2 Christoph Kappel
1925 3 Christoph Kappel
h2.  What is the difference between ViewSwitch and ViewJump?
1926 3 Christoph Kappel
1927 1 Christoph Kappel
Boths keys change the [[view]] of the current active [[screens|screen]], but the behavior how they do that depends on if the system consists either of a single [[screens|screen]] or more.
1928 2 Christoph Kappel
1929 3 Christoph Kappel
h2.  Single screen
1930 2 Christoph Kappel
1931 3 Christoph Kappel
1932 2 Christoph Kappel
Here both [[grabs]] do +exactly+ the same.
1933 2 Christoph Kappel
1934 3 Christoph Kappel
h2.  Multi screen
1935 2 Christoph Kappel
1936 3 Christoph Kappel
1937 2 Christoph Kappel
Here the behavior depends on if the selected [[views|view]] is visible on another [[screens|screen]] or not.
1938 1 Christoph Kappel
1939 1 Christoph Kappel
* *ViewSwitch* either swaps the current [[views|view]] with the selected if it is visible on another [[screens|screen]] or just sets the selected [[views|view]] on current [[screens|screen]].
1940 2 Christoph Kappel
* *ViewJump* either focus the selected [[views|view]] if it is visible on another [[screens|screen]] or just sets the select [[views|view]] on current [[screens|screen]].
1941 1 Christoph Kappel
1942 3 Christoph Kappel
h2.  Why does program XYZ appears/turns as/to a gray canvas?
1943 3 Christoph Kappel
1944 2 Christoph Kappel
Generally, this happens, when a program needs a specific aspect ratio and [[subtle]] sets a gravity that violates this. Windows can tell the window manager about this kind of preferences via their size hints and [[subtle]] can honor those.
1945 1 Christoph Kappel
1946 2 Christoph Kappel
There are two possible ways:
1947 1 Christoph Kappel
1948 2 Christoph Kappel
# Enable size hints globally with the _&#58;resize_ option
1949 2 Christoph Kappel
  <pre>{{hide}}<code class="ruby">set :resize, true</code></pre>
1950 2 Christoph Kappel
# Enable this per program via [[tagging|tag]]
1951 1 Christoph Kappel
  <pre>{{hide}}<code class="ruby">tag "name" do
1952 2 Christoph Kappel
  match  "name"
1953 1 Christoph Kappel
  resize true
1954 2 Christoph Kappel
end</code></pre>
1955 2 Christoph Kappel
1956 2 Christoph Kappel
bq. Note: This can happen with "Java":http://java.com too, see "here":http://subforge.org/ezfaq/show/subtle?faq_id=14 for more information.
1957 2 Christoph Kappel
1958 3 Christoph Kappel
h2.  How do I run a Java program?
1959 3 Christoph Kappel
1960 2 Christoph Kappel
"Java":http://java.com *expects* a certain behaviour (_reparenting of client windows_) of a window manager which is not part of any standard, therefore some "Java":http://java.com programs just show a white canvas.
1961 2 Christoph Kappel
1962 1 Christoph Kappel
If this happens just try to start your program like this:
1963 1 Christoph Kappel
1964 1 Christoph Kappel
<pre><code class="shell">AWT_TOOLKIT=MToolkit program</code></pre>
1965 2 Christoph Kappel
1966 1 Christoph Kappel
This changes the default tookit of "Java":http://java.com to _MToolkit_, which is known to work with non-reparenting windows managers like [[subtle]]. Depending on your "OpenJDK":http://openjdk.java.net version and your architecture this may either lead to a segmentation fault or your "OpenJDK":http://openjdk.java.net just has no support for *MToolkit*. In this case check if your distribution has applied a patch for this issue which allows something like this to change the default behaviour:
1967 1 Christoph Kappel
1968 1 Christoph Kappel
<pre><code class="shell">_JAVA_AWT_WM_NONREPARENTING=1 program</code></pre>
1969 2 Christoph Kappel
1970 2 Christoph Kappel
In case both doesn't work there is a third option: "Java":http://java.com seems to use an internally hardcoded list of window managers that are non-reparenting, the "suckless":http://suckless.org guys made a tool ("wmname":http://tools.suckless.org/wmname) to change the name of the wm.
1971 2 Christoph Kappel
1972 2 Christoph Kappel
Since r2520 [[subtle]] can do that for you, just enable the *&#58;wmname* option.
1973 2 Christoph Kappel
1974 2 Christoph Kappel
Generally this problem is really long lasting, see here: 
1975 2 Christoph Kappel
1976 1 Christoph Kappel
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6511454
1977 2 Christoph Kappel
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=508650
1978 1 Christoph Kappel
1979 2 Christoph Kappel
bq. Note: Many problems only affect the "JRE":http://www.oracle.com/technetwork/java/javase/downloads/index.html and can be avoided by using the "OpenJDK":http://openjdk.java.net.
1980 2 Christoph Kappel
1981 2 Christoph Kappel
1982 1 Christoph Kappel
1983 3 Christoph Kappel
h2.  How do I tag console based programs?
1984 3 Christoph Kappel
1985 2 Christoph Kappel
When console based programs like "irssi":http://irssi.org are started with a terminal like @urxvt -e irssi@, they usually just change the *WM_NAME* of the terminal and per default, [[subtle]] uses both of the *WM_CLASS* values for tagging.
1986 2 Christoph Kappel
1987 2 Christoph Kappel
The problem about that is, that the [[tagging]] is normally done before the terminal really starts the desired app. To avoid that all better known terminals support the *-name* argument which changes the instance value (first string) of the *WM_CLASS*: @urxvt -name irssi -e irssi@
1988 2 Christoph Kappel
1989 2 Christoph Kappel
Another problem is that terminals retain their class value (second string) of the *WM_CLASS* and may match other [[tagging|tags]] like:
1990 2 Christoph Kappel
1991 2 Christoph Kappel
<pre><code class="ruby">tag "terms" do
1992 2 Christoph Kappel
  match "urxvt"
1993 2 Christoph Kappel
end</code></pre>
1994 1 Christoph Kappel
1995 2 Christoph Kappel
The common solution to bypass is this to use the :instance matcher, which just matches when for the specific instance value. So the easiest way to reliable match this client is a [[tagging|tag]] like this:
1996 1 Christoph Kappel
1997 2 Christoph Kappel
<pre><code class="ruby">tag "irssi" do
1998 2 Christoph Kappel
  match :instance => "irssi"
1999 2 Christoph Kappel
end</code></pre>
2000 2 Christoph Kappel
2001 2 Christoph Kappel
Following table shows the *WM_NAME* and *WM_CLASS* output of "xprop":http://www.xfree86.org/current/xprop.1.html of the various combinations:
2002 2 Christoph Kappel
2003 2 Christoph Kappel
|_. Command                  |_. WM_NAME    |_. WM_CLASS   |
2004 2 Christoph Kappel
| urxvt                      | urxvt        | urxvt, URxvt |
2005 2 Christoph Kappel
| urxvt -e irssi             | irssi        | urxvt, URxvt |
2006 2 Christoph Kappel
| urxvt -name irssi          | urxvt        | irssi, URxvt |
2007 2 Christoph Kappel
| urxvt -name irssi -e irssi | irssi        | irssi, URxvt |
2008 2 Christoph Kappel
2009 2 Christoph Kappel
Please have a look at the [[Tagging|tagging wiki page]] for more information.
2010 2 Christoph Kappel
2011 2 Christoph Kappel
2012 2 Christoph Kappel
2013 2 Christoph Kappel
2014 3 Christoph Kappel
h2.  How can I use subtle without numpad?
2015 3 Christoph Kappel
2016 2 Christoph Kappel
Per default [[subtle]] uses the numpad, because it's easier to remind the different postions when you can see them. Generally this is just a suggestion, it's up to you to change the grabs to your needs - any keys will work. 
2017 2 Christoph Kappel
2018 2 Christoph Kappel
Keys that also have proven to work well are *q-w-e*, *a-s-d* and *y-x-c*:
2019 2 Christoph Kappel
2020 2 Christoph Kappel
<pre>{{hide}}<code class="ruby">grab "W-q", [ :top_left,     :top_left66,     :top_left33     ]
2021 2 Christoph Kappel
grab "W-w", [ :top,          :top66,          :top33          ]
2022 2 Christoph Kappel
grab "W-e", [ :top_right,    :top_right66,    :top_right33    ]
2023 2 Christoph Kappel
grab "W-a", [ :left,         :left66,         :left33         ]
2024 1 Christoph Kappel
grab "W-s", [ :center,       :center66,       :center33       ]
2025 2 Christoph Kappel
grab "W-d", [ :right,        :right66,        :right33        ]
2026 1 Christoph Kappel
2027 2 Christoph Kappel
# QWERTZ
2028 2 Christoph Kappel
grab "W-y", [ :bottom_left,  :bottom_left66,  :bottom_left33  ]
2029 2 Christoph Kappel
2030 2 Christoph Kappel
# QWERTY
2031 2 Christoph Kappel
grab "W-z", [ :bottom_left,  :bottom_left66,  :bottom_left33  ]
2032 2 Christoph Kappel
2033 2 Christoph Kappel
grab "W-x", [ :bottom,       :bottom66,       :bottom33       ]
2034 2 Christoph Kappel
grab "W-c", [ :bottom_right, :bottom_right66, :bottom_right33 ]
2035 2 Christoph Kappel
</code></pre>
2036 2 Christoph Kappel
2037 2 Christoph Kappel
2038 2 Christoph Kappel
You can find more about assigning keys [[Grabs|here]].
2039 2 Christoph Kappel
2040 3 Christoph Kappel
h2.  How does subtle match clients?
2041 3 Christoph Kappel
2042 2 Christoph Kappel
[[subtle]] matches the {{color(#ff0000, WM_NAME)}} and the {{color(#0000ff, WM_CLASS)}} property of a window and not the title. This to ensure the match is correct. 
2043 2 Christoph Kappel
There are several ways to get these values, here are the most common:
2044 2 Christoph Kappel
2045 2 Christoph Kappel
Select the window with "xprop":http://www.xfree86.org/current/xprop.1.htmland have a look for the {{color(#ff0000, WM_NAME)}} and {{color(#0000ff, WM_CLASS)}} lines which usually look like this:
2046 2 Christoph Kappel
2047 2 Christoph Kappel
<pre><code class="bash">{{color(#0000ff, WM_NAME)}}(STRING) = "urxvt"
2048 2 Christoph Kappel
{{color(#ff0000, WM_CLASS)}}(STRING) = {{color(#aa0000, "irssi")}}, {{color(#ff00ff, "URxvt")}}</code></pre>
2049 1 Christoph Kappel
2050 2 Christoph Kappel
Run *[[subtler]] -cl* and look for the matching line:
2051 2 Christoph Kappel
2052 1 Christoph Kappel
<pre><code class="bash">0x800007 * 1 1020x374 2 1 --- {{color(#ff0000, urxvt)}} ({{color(#0000ff,URxvt)}})</code></pre>
2053 2 Christoph Kappel
2054 3 Christoph Kappel
h2.  Is subtle a reparenting window manager?
2055 3 Christoph Kappel
2056 2 Christoph Kappel
*Nope*, [[subtle]] doesn't reparent windows and there is in fact *no* reason to do that. The layout in [[subtle]] is a really loose set, the only relation between a [[views|view]] and a [[client]] is [[tagging]] and this is checked on every [[views|view]] update.
2057 2 Christoph Kappel
2058 2 Christoph Kappel
Reparenting windows would require following additional steps, when a window is visible on a certain [[views|view]]:
2059 2 Christoph Kappel
2060 2 Christoph Kappel
# Resize the [[views|view]] toplevel window to the size of the current [[screen]]
2061 2 Christoph Kappel
# Reparent the [[client]] window to the toplevel window
2062 1 Christoph Kappel
# Handle (ignore here) the generated expose and crossing events
2063 2 Christoph Kappel
2064 1 Christoph Kappel
Probably sounds like not much overhead, but keep in mind this is just required because the developer of "Java":http://www.java.com/ and "Qt":http://qt.nokia.com/products/ cannot understand following line from the "ICCCM":http://tronche.com/gui/x/icccm/sec-4.html#s-4.2.1:
2065 2 Christoph Kappel
2066 2 Christoph Kappel
bq. Clients must be aware that some window managers will reparent their top-level windows so that a window that was created as a child of the root will be displayed as a child of some window belonging to the window manager
2067 2 Christoph Kappel
2068 3 Christoph Kappel
h2.  How do I move a program to another view?
2069 3 Christoph Kappel
2070 2 Christoph Kappel
Placement in [[subtle]] is +strict+ and completely done via [[tagging]]. There are many ways to change [[tagging|tags]] per runtime, common is to use either [[subtler]] or [[subtlext]].
2071 2 Christoph Kappel
2072 3 Christoph Kappel
h2.  subtler
2073 2 Christoph Kappel
2074 3 Christoph Kappel
2075 1 Christoph Kappel
[[subtler]] can be used on the commandline:
2076 2 Christoph Kappel
2077 1 Christoph Kappel
<pre>{{hide}}<code class="ruby">
2078 2 Christoph Kappel
subtler -ta tag         #< Add new tag 'tag'
2079 2 Christoph Kappel
subtler -cT client tag  #< Tag client 'client' with tag 'tag'
2080 2 Christoph Kappel
subtler -vT view tag    #< Tag view 'view' with tag 'tag'
2081 2 Christoph Kappel
</code></pre>
2082 2 Christoph Kappel
2083 3 Christoph Kappel
h2.  subtlext
2084 2 Christoph Kappel
2085 3 Christoph Kappel
2086 2 Christoph Kappel
[[subtlext]] requires basic "ruby":http://ruby-lang.org knowledge:
2087 2 Christoph Kappel
2088 2 Christoph Kappel
<pre>{{hide}}<code class="ruby">require "subtle/subtlext"
2089 2 Christoph Kappel
2090 2 Christoph Kappel
tag = Subtlext::Tag.new("tag").save  #< Add new tag 'tag'
2091 2 Christoph Kappel
Subtlext::Client["client"] + "tag"   #< Tag client 'client' with tag 'tag'
2092 2 Christoph Kappel
Subtlext::View["view"] + "tag"       #< Tag view 'view' with tag 'tag'
2093 2 Christoph Kappel
</code></pre>
2094 2 Christoph Kappel
2095 3 Christoph Kappel
h2.  Snippets
2096 2 Christoph Kappel
2097 3 Christoph Kappel
2098 2 Christoph Kappel
The [[snippets]] wiki page includes examples how to [[snippets#Move-windows|move to another view]].
2099 2 Christoph Kappel
2100 3 Christoph Kappel
h2.  Contrib
2101 2 Christoph Kappel
2102 3 Christoph Kappel
2103 2 Christoph Kappel
h3. Vitag
2104 2 Christoph Kappel
2105 2 Christoph Kappel
"subtle-contrib":http://subforge.org/projects/subtle-contrib/wiki contains [[subtle-contrib:vitag|vitag]] a script to change the [[tagging|tags]] of windows and views with an editor.
2106 2 Christoph Kappel
2107 2 Christoph Kappel
h3. Launcher
2108 2 Christoph Kappel
2109 2 Christoph Kappel
The "launcher":http://subforge.org/projects/subtle-contrib/wiki#Launcher uses quite the opposite way, instead of moving a window to a certain screen it just provides a way to launch a window directly on the right view with the correct [[tagging|tags]].
2110 2 Christoph Kappel
2111 3 Christoph Kappel
h2.  Stick
2112 2 Christoph Kappel
2113 3 Christoph Kappel
2114 2 Christoph Kappel
Most of the time, setting the window to *stick* does the trick too. Stick just displays the window on all views until the mode is disabled again. This can be done with [[grabs]] (default keys: *W-s*) or with [[subtler]]. (click on the window: @subtler -cXS@)
2115 2 Christoph Kappel
2116 2 Christoph Kappel
2117 2 Christoph Kappel
2118 3 Christoph Kappel
h2.  What is required for the volume sublet?
2119 3 Christoph Kappel
2120 2 Christoph Kappel
The volume [[sublets|sublet]] uses @/dev/mixer@ to set/get the volume levels, which is an older interface introduced with "OSS":http://www.opensound.com/ and still available via "ALSA OSS emulation":http://www.alsa-project.org/. Apparently, newer kernels refuse to autoload that module anymore and you need to load it manually or via any init file.
2121 2 Christoph Kappel
2122 2 Christoph Kappel
{{info(Please check to the docs of your distribution how to do it.)}}
2123 2 Christoph Kappel
2124 2 Christoph Kappel
<pre><code>modprobe snd_mixer_oss</code></pre>
2125 2 Christoph Kappel
2126 2 Christoph Kappel
{{warn(Following explanation is technical!)}}
2127 2 Christoph Kappel
2128 2 Christoph Kappel
The [[sublets|sublet]] needs a way to access a mixer without any asynchronous callbacks. The reason for that is that [[subtle]] is single-threaded and can't use a dedicated thread to wait for the reply, but the APIs of "ALSA":http://www.alsa-project.org/ and "PulseAudio":http://pulseaudio.org are both designed to be asynchronous. Normally event drivven is fine but it is troublesome when you can't use their mainloop.
2129 2 Christoph Kappel
2130 2 Christoph Kappel
Since there is no way to add e.g. a control socket to the event main loop of [[subtle]], the @/dev/mixer@ approach is the only way and works for all sound systems.