rumai 3.0.0 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. data/bin/rumai +2 -2
  2. data/doc/api/apple-touch-icon.png +0 -0
  3. data/doc/api/classes/IO.html +1 -1
  4. data/doc/api/classes/Integer.html +6 -6
  5. data/doc/api/classes/Rumai.html +141 -141
  6. data/doc/api/classes/Rumai/Area.html +122 -122
  7. data/doc/api/classes/Rumai/Chain.html +18 -18
  8. data/doc/api/classes/Rumai/Client.html +420 -122
  9. data/doc/api/classes/Rumai/ClientContainer.html +22 -22
  10. data/doc/api/classes/Rumai/IXP/Agent.html +90 -90
  11. data/doc/api/classes/Rumai/IXP/Agent/FidStream.html +41 -41
  12. data/doc/api/classes/Rumai/IXP/Agent/MODES.html +6 -6
  13. data/doc/api/classes/Rumai/IXP/Agent/RangedPool.html +18 -18
  14. data/doc/api/classes/Rumai/IXP/Fcall.html +30 -30
  15. data/doc/api/classes/Rumai/IXP/Qid.html +1 -1
  16. data/doc/api/classes/Rumai/IXP/Stat.html +7 -7
  17. data/doc/api/classes/Rumai/IXP/Stream.html +6 -6
  18. data/doc/api/classes/Rumai/IXP/Struct.html +24 -24
  19. data/doc/api/classes/Rumai/IXP/Struct/Field.html +36 -36
  20. data/doc/api/classes/Rumai/IXP/Struct/Field/CounteeField.html +12 -12
  21. data/doc/api/classes/Rumai/IXP/Struct/Field/CounterField.html +6 -6
  22. data/doc/api/classes/Rumai/IXP/Terror.html +6 -6
  23. data/doc/api/classes/Rumai/Node.html +52 -52
  24. data/doc/api/classes/Rumai/View.html +132 -132
  25. data/doc/api/classes/String.html +12 -12
  26. data/doc/api/classes/StringIO.html +1 -1
  27. data/doc/api/classes/Time.html +12 -12
  28. data/doc/api/created.rid +1 -1
  29. data/doc/api/favicon.ico +0 -0
  30. data/doc/api/files/CREDITS.html +1 -1
  31. data/doc/api/files/LICENSE.html +1 -1
  32. data/doc/api/files/lib/rumai/fs_rb.html +1 -1
  33. data/doc/api/files/lib/rumai/ixp/message_rb.html +1 -1
  34. data/doc/api/files/lib/rumai/ixp/transport_rb.html +1 -1
  35. data/doc/api/files/lib/rumai/ixp_rb.html +1 -1
  36. data/doc/api/files/lib/rumai/wm_rb.html +1 -1
  37. data/doc/api/files/lib/rumai_rb.html +1 -1
  38. data/doc/api/js/searchdoc.js +38 -15
  39. data/doc/api/panel/index.html +13 -5
  40. data/doc/api/panel/search_index.js +1 -1
  41. data/doc/api/panel/tree.js +1 -1
  42. data/doc/history.erb +79 -2
  43. data/doc/index.erb +2 -2
  44. data/doc/index.html +2017 -0
  45. data/doc/intro.erb +38 -62
  46. data/doc/setup.erb +53 -2
  47. data/doc/usage.erb +36 -11
  48. data/lib/rumai.rb +4 -4
  49. data/lib/rumai/fs.rb +2 -2
  50. data/lib/rumai/ixp.rb +2 -2
  51. data/lib/rumai/ixp/message.rb +2 -2
  52. data/lib/rumai/ixp/transport.rb +2 -2
  53. data/lib/rumai/wm.rb +80 -5
  54. data/rakefile +2 -2
  55. data/test/rumai/ixp/message.rb +3 -3
  56. metadata +9 -5
  57. data/doc/index.xhtml +0 -1078
@@ -1,30 +1,42 @@
1
1
  %#--
2
- %# Copyright 2008 Suraj N. Kurapati
3
- %# See the LICENSE file for details.
2
+ %# Copyright protects this work.
3
+ %# See LICENSE file for details.
4
4
  %#++
5
5
 
6
6
  % api_url = './api/index.html'
7
- % repo_url = 'http://github.com/sunaku/' + $program
8
- % repo_scm = '[Git](http://git-scm.com)'
7
+ % src_url = 'http://github.com/sunaku/' + $program
8
+ % src_scm = '[Git](http://git-scm.com)'
9
+
9
10
 
10
11
  %|chapter "Introduction"
12
+
13
+
11
14
  %|project
15
+
12
16
  <%= $project %> is a [Ruby](<%= ruby_url %>) interface to the [wmii](<%= wmii_url %>) window manager.
13
17
 
14
- * It excels at dynamic arrangement of clients, columns, views, and tags.
15
18
 
19
+ * <%= xref "History", "What's new?" %> --- history of project releases.
20
+ * [Source code](<%= src_url %>) --- obtain via <%= src_scm %> or browse online.
21
+ * [API reference](<%= api_url %>) --- documentation for source code.
22
+ * [Project home](<%= $website %>) --- the <%= $project %> project home page.
23
+
24
+ To get help or provide feedback, simply
25
+ <%= xref "License", "contact the author(s)" %>.
26
+
27
+
28
+ %|section "Features"
29
+
30
+ <%= $project %> is exciting because:
31
+
32
+ * It excels at dynamic arrangement of clients, columns, views, and tags.
16
33
  * It provides an <%= xref 'shell', 'interactive shell' %> for live entertainment and experimentation.
34
+ * It provides a pure Ruby client for the [9P2000 protocol](<%= p9p_url %>), upon which wmii's [IXP file-system interface](<%= wmii_ixp_url %>) is built.
17
35
 
18
- * It contains a pure Ruby client for the [9P2000 protocol](<%= p9p_url %>) on which wmii's [IXP file-system interface](<%= wmii_ixp_url %>) is built.
19
36
 
20
- These features distinguish <%= $project %> from the competition:
21
- * [r9p](http://libs.suckless.org/r9p)
22
- * [Rii](http://rubyforge.org/projects/rii/)
23
- * [Ruby-IXP](http://home.gna.org/rubyixp/)
24
- * [ruby-wmii](http://eigenclass.org/hiki.rb?wmii+ruby)
37
+ %|section "Etymology"
25
38
 
26
- %|paragraph "Etymology"
27
- The word "wmii" is incredibly difficult to pronounce because it is an abbreviation, not an acronym. If we were to treat it as an acronym, the closest pronounciation would be, in my mind, something like "vim-eye".
39
+ The word "wmii" is difficult to pronounce because it is an abbreviation, not an acronym. If we were to treat it as an acronym, the closest pronounciation would be, in my mind, something like "vim-eye".
28
40
 
29
41
  Since this is a Ruby library, I added a "roo" and worked it through:
30
42
 
@@ -34,61 +46,25 @@
34
46
 
35
47
  And thus we get "Rumai".
36
48
 
37
- %|section "Logistics"
38
- * <%= xref "History", "Release notes" %> --- history of project releases.
39
- * [Source code](<%= repo_url %>) --- obtain via <%= repo_scm %> or browse online.
40
- * [API reference](<%= api_url %>) --- documentation for source code.
41
- * [Project home](<%= $website %>) --- the <%= $project %> project home page.
42
-
43
- To get help or provide feedback, simply
44
- <%= xref "License", "contact the author(s)" %>.
45
-
46
- %|paragraph "Version numbers"
47
- <%= $project %> releases are numbered in *major.minor.patch*
48
- form according to the [RubyGems rational versioning
49
- policy](http://www.rubygems.org/read/chapter/7), which
50
- can be summarized thus:
51
-
52
- <table markdown="1">
53
- <thead>
54
- <tr>
55
- <td rowspan="2">What increased in the version number?</td>
56
- <td colspan="3">The increase indicates that the release:</td>
57
- </tr>
58
- <tr>
59
- <th>Is backward compatible?</th>
60
- <th>Has new features?</th>
61
- <th>Has bug fixes?</th>
62
- </tr>
63
- </thead>
64
- <tbody>
65
- <tr>
66
- <th>major</th>
67
- <td style="background-color: #FFE4E1;">No</td>
68
- <td>Yes</td>
69
- <td>Yes</td>
70
- </tr>
71
- <tr>
72
- <th>minor</th>
73
- <td>Yes</td>
74
- <td>Yes</td>
75
- <td>Yes</td>
76
- </tr>
77
- <tr>
78
- <th>patch</th>
79
- <td>Yes</td>
80
- <td style="background-color: #FFE4E1;">No</td>
81
- <td>Yes</td>
82
- </tr>
83
- </tbody>
84
- </table>
85
49
 
86
50
  %|section "License"
51
+
87
52
  %< "../LICENSE"
88
53
 
54
+
89
55
  %|section "Credits"
56
+
90
57
  <%= $project %> is made possible by
91
- <%= xref "History", "contributions" %>
58
+ %= xref "History", "contributions"
92
59
  from users like you:
93
60
 
94
61
  %< "../CREDITS"
62
+
63
+
64
+ %|section "Related works"
65
+
66
+ * [r9p](http://libs.suckless.org/r9p)
67
+ * [Rii](http://rubyforge.org/projects/rii/)
68
+ * [Ruby-IXP](http://home.gna.org/rubyixp/)
69
+ * [ruby-wmii](http://eigenclass.org/hiki.rb?wmii+ruby)
70
+
@@ -1,10 +1,14 @@
1
1
  %#--
2
- %# Copyright 2008 Suraj N. Kurapati
3
- %# See the LICENSE file for details.
2
+ %# Copyright protects this work.
3
+ %# See LICENSE file for details.
4
4
  %#++
5
5
 
6
+
6
7
  %|chapter "Setup"
8
+
9
+
7
10
  %|section "Requirements"
11
+
8
12
  Your system needs the following software to run <%= $project %>.
9
13
 
10
14
  | Software | Description | Notes |
@@ -13,7 +17,9 @@
13
17
  | [RubyGems](http://rubygems.org) | Ruby packaging system | Version 1.3.1 or newer is required. |
14
18
  | [wmii](<%= wmii_url %>) | Window manager | Version 3.6 or newer is required. |
15
19
 
20
+
16
21
  %|section "Installation"
22
+
17
23
  You can install <%= $project %> by running this command:
18
24
 
19
25
  gem install <%= $program %>
@@ -29,7 +35,9 @@
29
35
  If you do not see such output, you may
30
36
  <%= xref "License", "ask the author(s)" %> for help.
31
37
 
38
+
32
39
  %|section "Manifest"
40
+
33
41
  You will see the following items inside <%= $project %>'s installation
34
42
  directory, whose path you can determine by running this command:
35
43
 
@@ -54,3 +62,46 @@
54
62
  * <tt>index.erb</tt> --- source of this user manual.
55
63
 
56
64
  * <tt>LICENSE</tt> --- copyright notice and legal conditions.
65
+
66
+
67
+ %|section "Version numbers"
68
+
69
+ <%= $project %> releases are numbered in *major.minor.patch*
70
+ form according to the [RubyGems rational versioning
71
+ policy](http://www.rubygems.org/read/chapter/7), which
72
+ can be summarized thus:
73
+
74
+ <table markdown="1">
75
+ <thead>
76
+ <tr>
77
+ <td rowspan="2">What increased in the version number?</td>
78
+ <td colspan="3">The increase indicates that the release:</td>
79
+ </tr>
80
+ <tr>
81
+ <th>Is backward compatible?</th>
82
+ <th>Has new features?</th>
83
+ <th>Has bug fixes?</th>
84
+ </tr>
85
+ </thead>
86
+ <tbody>
87
+ <tr>
88
+ <th>major</th>
89
+ <td style="background-color: #FFE4E1;">No</td>
90
+ <td>Yes</td>
91
+ <td>Yes</td>
92
+ </tr>
93
+ <tr>
94
+ <th>minor</th>
95
+ <td>Yes</td>
96
+ <td>Yes</td>
97
+ <td>Yes</td>
98
+ </tr>
99
+ <tr>
100
+ <th>patch</th>
101
+ <td>Yes</td>
102
+ <td style="background-color: #FFE4E1;">No</td>
103
+ <td>Yes</td>
104
+ </tr>
105
+ </tbody>
106
+ </table>
107
+
@@ -1,10 +1,14 @@
1
1
  %#--
2
- %# Copyright 2008 Suraj N. Kurapati
3
- %# See the LICENSE file for details.
2
+ %# Copyright protects this work.
3
+ %# See LICENSE file for details.
4
4
  %#++
5
5
 
6
+
6
7
  %|chapter "Usage"
8
+
9
+
7
10
  %|section "Concepts"
11
+
8
12
  Client
9
13
  : Any graphical program (a "window") that is running in your X session.
10
14
 
@@ -26,7 +30,9 @@
26
30
  * can overlap each other
27
31
  * float above clients in the managed areas
28
32
 
33
+
29
34
  %|section "Command-line interface"
35
+
30
36
  When you run this command:
31
37
 
32
38
  <%= $program %> --help
@@ -35,10 +41,12 @@
35
41
 
36
42
  <pre><%= verbatim `ruby bin/#{$program} --help` %></pre>
37
43
 
44
+
38
45
  %|paragraph "Interactive shell", "shell"
46
+
39
47
  When you run this command:
40
48
 
41
- <%= $program %>
49
+ %= $program
42
50
 
43
51
  An IRB session will begin, showing you a command prompt like this:
44
52
 
@@ -50,7 +58,9 @@
50
58
 
51
59
  The next thing to note is that **tab completion** is enabled by default. So you can type part of a command and press the TAB key to see a list of possible completions.
52
60
 
61
+
53
62
  %|section "Tutorial"
63
+
54
64
  Now that you know <%= xref "shell", "how to start the interactive shell" %>, let us walk through a quick demonstration that highlights the main features of <%= $project %>. You can follow along by copying & pasting the presented commands into the interactive shell.
55
65
 
56
66
  <%
@@ -73,8 +83,10 @@
73
83
  }.gsub(/^\s+/, '')
74
84
  %>
75
85
 
86
+
76
87
  %|section "Automated client arrangement"
77
- <%= open_terms %>
88
+
89
+ %= open_terms
78
90
 
79
91
  Arrange all clients in a grid:
80
92
 
@@ -94,10 +106,12 @@
94
106
  curr_view.arrange_as_larswm
95
107
  </code>
96
108
 
97
- <%= close_terms %>
109
+ %= close_terms
110
+
98
111
 
99
112
  %|section "Multiple client grouping"
100
- <%= open_terms %>
113
+
114
+ %= open_terms
101
115
 
102
116
  Add the red, green, and blue terminals into the "grouping":
103
117
 
@@ -127,14 +141,16 @@
127
141
  grouping.each {|c| c.send "toggle" }
128
142
  </code>
129
143
 
130
- <%= close_terms %>
144
+ %= close_terms
131
145
 
132
146
  In summary, you can select multiple clients (by adding them to the "grouping") and perform operations on them. This is useful when you want to do something with a group of clients but do not want to manually focus one, perform the action, focus the next one, and so on.
133
147
 
134
148
  Another important aspect is that selected clients stay selected until they are unselected. This allows you to continue performing tasks on the selection without having to reselect the same clients after every operation.
135
149
 
150
+
136
151
  %|section "Easy column manipulation"
137
- <%= open_terms %>
152
+
153
+ %= open_terms
138
154
 
139
155
  You can insert a group of clients to the top, bottom, or after the currently focused client of _any_ column using Array-like methods.
140
156
 
@@ -184,10 +200,12 @@
184
200
  curr_view.areas[3].push terms
185
201
  </code>
186
202
 
187
- <%= close_terms %>
203
+ %= close_terms
204
+
188
205
 
189
206
  %|section "Easy client manipulation"
190
- <%= open_terms %>
207
+
208
+ %= open_terms
191
209
 
192
210
  Obtain a reference to the red client:
193
211
 
@@ -248,9 +266,11 @@
248
266
  red.send curr_view.areas.last
249
267
  </code>
250
268
 
251
- <%= close_terms %>
269
+ %= close_terms
270
+
252
271
 
253
272
  %|section "Traversing the file system"
273
+
254
274
  Show the root node of wmii's IXP file system:
255
275
 
256
276
  <code>
@@ -312,8 +332,13 @@
312
332
  b.exist? #=> false
313
333
  </code>
314
334
 
335
+
315
336
  %|section "Available commands"
337
+
316
338
  Refer to the `Rumai` module in the [API documentation](api/index.html) for a complete list of commands (method calls, really) and their documentation.
317
339
 
340
+
318
341
  %|section "Scripting your wmiirc", 'wmiirc'
342
+
319
343
  One important application of <%= $project %> is the support of Ruby-based <tt>wmiirc</tt> configuration files. For a solid example of such application, take a look at [my personal <tt>wmiirc</tt>](http://github.com/sunaku/wmiirc/).
344
+
@@ -1,6 +1,6 @@
1
1
  #--
2
- # Copyright 2008 Suraj N. Kurapati
3
- # See the LICENSE file for details.
2
+ # Copyright protects this work.
3
+ # See LICENSE file for details.
4
4
  #++
5
5
 
6
6
  require 'rubygems'
@@ -8,8 +8,8 @@ gem 'inochi', '~> 1'
8
8
  require 'inochi'
9
9
 
10
10
  Inochi.init :Rumai,
11
- :version => '3.0.0',
12
- :release => '2009-05-11',
11
+ :version => '3.1.0',
12
+ :release => '2009-10-02',
13
13
  :website => 'http://snk.tuxfamily.org/lib/rumai/',
14
14
  :tagline => 'Ruby interface to the wmii window manager',
15
15
  :develop => {
@@ -1,7 +1,7 @@
1
1
  # File system abstractions over the 9P2000 protocol.
2
2
  #--
3
- # Copyright 2006 Suraj N. Kurapati
4
- # See the LICENSE file for details.
3
+ # Copyright protects this work.
4
+ # See LICENSE file for details.
5
5
  #++
6
6
 
7
7
  require 'rumai/ixp'
@@ -1,7 +1,7 @@
1
1
  # An interface to wmii's IXP library for Rumai.
2
2
  #--
3
- # Copyright 2007 Suraj N. Kurapati
4
- # See the LICENSE file for details.
3
+ # Copyright protects this work.
4
+ # See LICENSE file for details.
5
5
  #++
6
6
 
7
7
  require 'rumai/ixp/message'
@@ -5,8 +5,8 @@
5
5
  # See http://swtch.com/plan9port/man/man9/
6
6
  #
7
7
  #--
8
- # Copyright 2007 Suraj N. Kurapati
9
- # See the LICENSE file for details.
8
+ # Copyright protects this work.
9
+ # See LICENSE file for details.
10
10
  #++
11
11
 
12
12
  module Rumai
@@ -1,7 +1,7 @@
1
1
  # Transport layer for 9P2000 protocol.
2
2
  #--
3
- # Copyright 2007 Suraj N. Kurapati
4
- # See the LICENSE file for details.
3
+ # Copyright protects this work.
4
+ # See LICENSE file for details.
5
5
  #++
6
6
 
7
7
  require 'rumai/ixp/message'
@@ -1,7 +1,7 @@
1
1
  # Abstractions for the window manager.
2
2
  #--
3
- # Copyright 2006 Suraj N. Kurapati
4
- # See the LICENSE file for details.
3
+ # Copyright protects this work.
4
+ # See LICENSE file for details.
5
5
  #++
6
6
 
7
7
  require 'rumai/fs'
@@ -144,7 +144,7 @@ module Rumai
144
144
  distance = (src - dst).abs
145
145
  direction = src < dst ? :down : :up
146
146
 
147
- distance.times { v.move_focus direction }
147
+ distance.times { v.select direction }
148
148
 
149
149
  break
150
150
  end
@@ -248,6 +248,46 @@ module Rumai
248
248
  end
249
249
  end
250
250
 
251
+ ##
252
+ # Checks if this client is in the floating area of the given view.
253
+ #
254
+ def float? view = View.curr
255
+ area(view).floating?
256
+ end
257
+
258
+ ##
259
+ # Puts this client into the floating area of the given view.
260
+ #
261
+ def float view = View.curr
262
+ send :toggle, view unless float? view
263
+ end
264
+
265
+ ##
266
+ # Puts this client into the managed area of the given view.
267
+ #
268
+ def unfloat view = View.curr
269
+ send :toggle, view if float? view
270
+ end
271
+
272
+ ##
273
+ # Toggles the floating status of this client in the given view.
274
+ #
275
+ def float! view = View.curr
276
+ send :toggle, view
277
+ end
278
+
279
+ ##
280
+ # Checks if this client is in the managed area of the given view.
281
+ def manage? view = View.curr
282
+ not float? view
283
+ end
284
+
285
+ alias manage unfloat
286
+
287
+ alias unmanage float
288
+
289
+ alias manage! float!
290
+
251
291
  # WM hierarchy
252
292
 
253
293
  ##
@@ -278,9 +318,44 @@ module Rumai
278
318
  ##
279
319
  # Modifies the tags associated with this client.
280
320
  #
321
+ # If a tag name is '~', this client is placed
322
+ # into the floating layer of the current view.
323
+ #
324
+ # If a tag name begins with '~', then this
325
+ # client is placed into the floating layer
326
+ # of the view corresponding to that tag.
327
+ #
328
+ # If a tag name is '!', this client is placed
329
+ # into the managed layer of the current view.
330
+ #
331
+ # If a tag name begins with '!', then this
332
+ # client is placed into the managed layer
333
+ # of the view corresponding to that tag.
334
+ #
281
335
  def tags= *tags
282
- arr = tags.flatten.compact.uniq
283
- self[:tags].write arr.join(TAG_DELIMITER)
336
+ float = []
337
+ manage = []
338
+ inherit = []
339
+
340
+ tags.join(TAG_DELIMITER).split(TAG_DELIMITER).each do |tag|
341
+ case tag
342
+ when '~' then float << Rumai.curr_tag
343
+ when /^~/ then float << $'
344
+ when '!' then manage << Rumai.curr_tag
345
+ when /^!/ then manage << $'
346
+ else inherit << tag
347
+ end
348
+ end
349
+
350
+ self[:tags].write((float + manage + inherit).uniq.join(TAG_DELIMITER))
351
+
352
+ float.each do |tag|
353
+ self.float View.new(tag)
354
+ end
355
+
356
+ manage.each do |tag|
357
+ self.manage View.new(tag)
358
+ end
284
359
  end
285
360
 
286
361
  ##