Project

General

Profile

unexist.dev

/

subtle

Assorted tidbits and projects

FAQ » History » Version 2

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

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