rumai 2.0.2 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CREDITS +2 -0
- data/bin/rumai +20 -8
- data/doc/api/classes/IO.html +72 -0
- data/doc/api/classes/Integer.html +110 -0
- data/doc/api/classes/Object.html +60 -0
- data/doc/api/classes/Rumai.html +867 -0
- data/doc/api/classes/Rumai/Area.html +836 -0
- data/doc/api/classes/Rumai/Chain.html +197 -0
- data/doc/api/classes/Rumai/Client.html +865 -0
- data/doc/api/classes/Rumai/ClientContainer.html +191 -0
- data/doc/api/classes/Rumai/ExportInstanceMethods.html +69 -0
- data/doc/api/classes/Rumai/IXP.html +131 -0
- data/doc/api/classes/Rumai/IXP/Agent.html +836 -0
- data/doc/api/classes/Rumai/IXP/Agent/FidStream.html +456 -0
- data/doc/api/classes/Rumai/IXP/Agent/MODES.html +108 -0
- data/doc/api/classes/Rumai/IXP/Agent/RangedPool.html +241 -0
- data/doc/api/classes/Rumai/IXP/Error.html +67 -0
- data/doc/api/classes/Rumai/IXP/Fcall.html +323 -0
- data/doc/api/classes/Rumai/IXP/Qid.html +153 -0
- data/doc/api/classes/Rumai/IXP/Rattach.html +67 -0
- data/doc/api/classes/Rumai/IXP/Rauth.html +67 -0
- data/doc/api/classes/Rumai/IXP/Rclunk.html +67 -0
- data/doc/api/classes/Rumai/IXP/Rcreate.html +67 -0
- data/doc/api/classes/Rumai/IXP/Rerror.html +67 -0
- data/doc/api/classes/Rumai/IXP/Rflush.html +67 -0
- data/doc/api/classes/Rumai/IXP/Ropen.html +67 -0
- data/doc/api/classes/Rumai/IXP/Rread.html +67 -0
- data/doc/api/classes/Rumai/IXP/Rremove.html +67 -0
- data/doc/api/classes/Rumai/IXP/Rstat.html +67 -0
- data/doc/api/classes/Rumai/IXP/Rversion.html +67 -0
- data/doc/api/classes/Rumai/IXP/Rwalk.html +67 -0
- data/doc/api/classes/Rumai/IXP/Rwrite.html +67 -0
- data/doc/api/classes/Rumai/IXP/Rwstat.html +67 -0
- data/doc/api/classes/Rumai/IXP/Stat.html +252 -0
- data/doc/api/classes/Rumai/IXP/Stream.html +131 -0
- data/doc/api/classes/Rumai/IXP/Struct.html +315 -0
- data/doc/api/classes/Rumai/IXP/Struct/Field.html +415 -0
- data/doc/api/classes/Rumai/IXP/Struct/Field/CounteeField.html +153 -0
- data/doc/api/classes/Rumai/IXP/Struct/Field/CounterField.html +104 -0
- data/doc/api/classes/Rumai/IXP/Tattach.html +68 -0
- data/doc/api/classes/Rumai/IXP/Tauth.html +67 -0
- data/doc/api/classes/Rumai/IXP/Tclunk.html +67 -0
- data/doc/api/classes/Rumai/IXP/Tcreate.html +68 -0
- data/doc/api/classes/Rumai/IXP/Terror.html +110 -0
- data/doc/api/classes/Rumai/IXP/Tflush.html +67 -0
- data/doc/api/classes/Rumai/IXP/Topen.html +165 -0
- data/doc/api/classes/Rumai/IXP/Tread.html +67 -0
- data/doc/api/classes/Rumai/IXP/Tremove.html +67 -0
- data/doc/api/classes/Rumai/IXP/Tstat.html +67 -0
- data/doc/api/classes/Rumai/IXP/Tversion.html +86 -0
- data/doc/api/classes/Rumai/IXP/Twalk.html +68 -0
- data/doc/api/classes/Rumai/IXP/Twrite.html +68 -0
- data/doc/api/classes/Rumai/IXP/Twstat.html +67 -0
- data/doc/api/classes/Rumai/Node.html +817 -0
- data/doc/api/classes/Rumai/View.html +818 -0
- data/doc/api/classes/Rumai/WidgetImpl.html +65 -0
- data/doc/api/classes/Rumai/WidgetNode.html +68 -0
- data/doc/api/classes/String.html +163 -0
- data/doc/api/classes/StringIO.html +72 -0
- data/doc/api/classes/Time.html +156 -0
- data/doc/api/created.rid +1 -0
- data/doc/api/css/main.css +263 -0
- data/doc/api/css/panel.css +383 -0
- data/doc/api/css/reset.css +53 -0
- data/doc/api/files/CREDITS.html +64 -0
- data/doc/api/files/LICENSE.html +76 -0
- data/doc/api/files/lib/rumai/fs_rb.html +75 -0
- data/doc/api/files/lib/rumai/ixp/message_rb.html +91 -0
- data/doc/api/files/lib/rumai/ixp/transport_rb.html +75 -0
- data/doc/api/files/lib/rumai/ixp_rb.html +69 -0
- data/doc/api/files/lib/rumai/wm_rb.html +77 -0
- data/doc/api/files/lib/rumai_rb.html +65 -0
- data/doc/api/i/arrows.png +0 -0
- data/doc/api/i/results_bg.png +0 -0
- data/doc/api/i/tree_bg.png +0 -0
- data/doc/api/index.html +14 -18
- data/doc/api/js/jquery-1.3.2.min.js +19 -0
- data/doc/api/js/jquery-effect.js +593 -0
- data/doc/api/js/main.js +22 -0
- data/doc/api/js/searchdoc.js +605 -0
- data/doc/api/panel/index.html +63 -0
- data/doc/api/panel/search_index.js +1 -0
- data/doc/api/panel/tree.js +1 -0
- data/doc/history.erb +41 -16
- data/doc/index.erb +14 -11
- data/doc/index.xhtml +519 -846
- data/doc/intro.erb +33 -32
- data/doc/setup.erb +14 -13
- data/doc/usage.erb +69 -35
- data/lib/rumai.rb +13 -5
- data/lib/rumai/fs.rb +71 -27
- data/lib/rumai/ixp.rb +4 -0
- data/lib/rumai/ixp/message.rb +178 -81
- data/lib/rumai/ixp/transport.rb +144 -91
- data/lib/rumai/wm.rb +717 -593
- data/rakefile +14 -0
- data/test/rumai/ixp/message.rb +42 -54
- metadata +110 -89
- data/Rakefile +0 -8
- data/doc/api/IO.html +0 -53
- data/doc/api/Integer.html +0 -102
- data/doc/api/Object.html +0 -23
- data/doc/api/Rumai.html +0 -1218
- data/doc/api/Rumai/Area.html +0 -1088
- data/doc/api/Rumai/Chain.html +0 -230
- data/doc/api/Rumai/Client.html +0 -1264
- data/doc/api/Rumai/ClientContainer.html +0 -227
- data/doc/api/Rumai/ExportInstMethods.html +0 -115
- data/doc/api/Rumai/IXP.html +0 -23
- data/doc/api/Rumai/IXP/Agent.html +0 -1222
- data/doc/api/Rumai/IXP/Agent/FidStream.html +0 -602
- data/doc/api/Rumai/IXP/Agent/RangedPool.html +0 -263
- data/doc/api/Rumai/IXP/Error.html +0 -32
- data/doc/api/Rumai/IXP/Fcall.html +0 -398
- data/doc/api/Rumai/IXP/Qid.html +0 -99
- data/doc/api/Rumai/IXP/Rattach.html +0 -71
- data/doc/api/Rumai/IXP/Rauth.html +0 -71
- data/doc/api/Rumai/IXP/Rclunk.html +0 -71
- data/doc/api/Rumai/IXP/Rcreate.html +0 -71
- data/doc/api/Rumai/IXP/Rerror.html +0 -71
- data/doc/api/Rumai/IXP/Rflush.html +0 -71
- data/doc/api/Rumai/IXP/Ropen.html +0 -71
- data/doc/api/Rumai/IXP/Rread.html +0 -71
- data/doc/api/Rumai/IXP/Rremove.html +0 -71
- data/doc/api/Rumai/IXP/Rstat.html +0 -71
- data/doc/api/Rumai/IXP/Rversion.html +0 -71
- data/doc/api/Rumai/IXP/Rwalk.html +0 -71
- data/doc/api/Rumai/IXP/Rwrite.html +0 -71
- data/doc/api/Rumai/IXP/Rwstat.html +0 -71
- data/doc/api/Rumai/IXP/Stat.html +0 -188
- data/doc/api/Rumai/IXP/Stream.html +0 -112
- data/doc/api/Rumai/IXP/Struct.html +0 -348
- data/doc/api/Rumai/IXP/Struct/ClassField.html +0 -177
- data/doc/api/Rumai/IXP/Struct/Field.html +0 -549
- data/doc/api/Rumai/IXP/Struct/Field/CounteeField.html +0 -175
- data/doc/api/Rumai/IXP/Struct/Field/CounterField.html +0 -95
- data/doc/api/Rumai/IXP/Struct/Integer8Field.html +0 -181
- data/doc/api/Rumai/IXP/Struct/StringField.html +0 -128
- data/doc/api/Rumai/IXP/Tattach.html +0 -71
- data/doc/api/Rumai/IXP/Tauth.html +0 -71
- data/doc/api/Rumai/IXP/Tclunk.html +0 -71
- data/doc/api/Rumai/IXP/Tcreate.html +0 -71
- data/doc/api/Rumai/IXP/Terror.html +0 -156
- data/doc/api/Rumai/IXP/Tflush.html +0 -71
- data/doc/api/Rumai/IXP/Topen.html +0 -113
- data/doc/api/Rumai/IXP/Tread.html +0 -71
- data/doc/api/Rumai/IXP/Tremove.html +0 -71
- data/doc/api/Rumai/IXP/Tstat.html +0 -71
- data/doc/api/Rumai/IXP/Tversion.html +0 -83
- data/doc/api/Rumai/IXP/Twalk.html +0 -71
- data/doc/api/Rumai/IXP/Twrite.html +0 -71
- data/doc/api/Rumai/IXP/Twstat.html +0 -71
- data/doc/api/Rumai/Node.html +0 -1139
- data/doc/api/Rumai/View.html +0 -1280
- data/doc/api/Rumai/WidgetImpl.html +0 -196
- data/doc/api/Rumai/WidgetNode.html +0 -184
- data/doc/api/String.html +0 -180
- data/doc/api/StringIO.html +0 -53
- data/doc/api/Time.html +0 -175
- data/doc/api/all-methods.html +0 -1436
- data/doc/api/all-namespaces.html +0 -140
- data/doc/api/app.js +0 -18
- data/doc/api/jquery.js +0 -11
- data/doc/api/readme.html +0 -38
- data/doc/api/style.css +0 -68
- data/doc/api/syntax_highlight.css +0 -21
- data/doc/theory.erb +0 -3
data/doc/intro.erb
CHANGED
@@ -1,41 +1,47 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
%#--
|
2
|
+
%# Copyright 2008 Suraj N. Kurapati
|
3
|
+
%# See the LICENSE file for details.
|
4
|
+
%#++
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
* 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.
|
6
|
+
% api_url = './api/index.html'
|
7
|
+
% repo_url = 'http://github.com/sunaku/' + $program
|
8
|
+
% repo_scm = '[Git](http://git-scm.com)'
|
10
9
|
|
11
|
-
|
10
|
+
%|chapter "Introduction"
|
11
|
+
%|project
|
12
|
+
<%= $project %> is a [Ruby](<%= ruby_url %>) interface to the [wmii](<%= wmii_url %>) window manager.
|
13
|
+
* It excels at dynamic arrangement of clients, columns, views, and tags.
|
14
|
+
* It provides an <%= xref 'shell', 'interactive shell' %> for live entertainment.
|
15
|
+
* 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.
|
16
|
+
|
17
|
+
These features distinguish <%= $project %> from the competition:
|
18
|
+
* [r9p](http://libs.suckless.org/r9p)
|
19
|
+
* [Rii](http://rubyforge.org/projects/rii/)
|
20
|
+
* [Ruby-IXP](http://home.gna.org/rubyixp/)
|
12
21
|
* [ruby-wmii](http://eigenclass.org/hiki.rb?wmii+ruby)
|
13
|
-
* [Rii](http://)
|
14
|
-
* [Ruby-IXP](http://)
|
15
22
|
|
16
|
-
|
23
|
+
%|paragraph "Etymology"
|
17
24
|
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".
|
18
25
|
|
19
26
|
Since this is a Ruby library, I added a "roo" and worked it through:
|
20
27
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
roo-mai
|
28
|
+
* vim-eye
|
29
|
+
* roo-vim-eye
|
30
|
+
* roovm-eye
|
25
31
|
|
26
32
|
And thus we get "Rumai".
|
27
|
-
<% end %>
|
28
33
|
|
29
|
-
|
34
|
+
%|section "Logistics"
|
30
35
|
* <%= xref "History", "Release notes" %> --- history of project releases.
|
31
|
-
* [Source code](
|
32
|
-
* [API reference](
|
36
|
+
* [Source code](<%= repo_url %>) --- obtain via <%= repo_scm %> or browse online.
|
37
|
+
* [API reference](<%= api_url %>) --- documentation for source code.
|
38
|
+
* [Project home](<%= $website %>) --- the <%= $project %> project home page.
|
33
39
|
|
34
40
|
To get help or provide feedback, simply
|
35
41
|
<%= xref "License", "contact the author(s)" %>.
|
36
42
|
|
37
|
-
|
38
|
-
|
43
|
+
%|paragraph "Version numbers"
|
44
|
+
<%= $project %> releases are numbered in *major.minor.patch*
|
39
45
|
form according to the [RubyGems rational versioning
|
40
46
|
policy](http://www.rubygems.org/read/chapter/7), which
|
41
47
|
can be summarized thus:
|
@@ -73,18 +79,13 @@
|
|
73
79
|
</tr>
|
74
80
|
</tbody>
|
75
81
|
</table>
|
76
|
-
<% end %>
|
77
|
-
<% end %>
|
78
82
|
|
79
|
-
|
80
|
-
|
81
|
-
<% end %>
|
83
|
+
%|section "License"
|
84
|
+
%< "../LICENSE"
|
82
85
|
|
83
|
-
|
84
|
-
|
86
|
+
%|section "Credits"
|
87
|
+
<%= $project %> is made possible by
|
85
88
|
<%= xref "History", "contributions" %>
|
86
89
|
from users like you:
|
87
90
|
|
88
|
-
|
89
|
-
<% end %>
|
90
|
-
<% end %>
|
91
|
+
%< "../CREDITS"
|
data/doc/setup.erb
CHANGED
@@ -1,16 +1,20 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
%#--
|
2
|
+
%# Copyright 2008 Suraj N. Kurapati
|
3
|
+
%# See the LICENSE file for details.
|
4
|
+
%#++
|
5
|
+
|
6
|
+
%|chapter "Setup"
|
7
|
+
%|section "Requirements"
|
8
|
+
Your system needs the following software to run <%= $project %>.
|
4
9
|
|
5
10
|
| Software | Description | Notes |
|
6
11
|
| -------- | ----------- | ----- |
|
7
12
|
| [Ruby](http://ruby-lang.org) | Ruby language interpreter | Version 1.8.6 or newer is required. |
|
8
13
|
| [RubyGems](http://rubygems.org) | Ruby packaging system | Version 1.3.1 or newer is required. |
|
9
14
|
| [wmii](<%= wmii_url %>) | Window manager | Version 3.6 or newer is required. |
|
10
|
-
<% end %>
|
11
15
|
|
12
|
-
|
13
|
-
You can install
|
16
|
+
%|section "Installation"
|
17
|
+
You can install <%= $project %> by running this command:
|
14
18
|
|
15
19
|
gem install <%= $program %>
|
16
20
|
|
@@ -24,21 +28,20 @@
|
|
24
28
|
|
25
29
|
If you do not see such output, you may
|
26
30
|
<%= xref "License", "ask the author(s)" %> for help.
|
27
|
-
<% end %>
|
28
31
|
|
29
|
-
|
30
|
-
You will see the following items inside
|
32
|
+
%|section "Manifest"
|
33
|
+
You will see the following items inside <%= $project %>'s installation
|
31
34
|
directory, whose path you can determine by running this command:
|
32
35
|
|
33
36
|
<%= $program %> --version
|
34
37
|
|
35
38
|
* <tt>bin/</tt>
|
36
39
|
|
37
|
-
* <tt><%= $program %></tt> --- the main
|
40
|
+
* <tt><%= $program %></tt> --- the main <%= $project %> executable.
|
38
41
|
|
39
42
|
* <tt>lib/</tt>
|
40
43
|
|
41
|
-
* <tt><%= $program %>.rb</tt> --- the main
|
44
|
+
* <tt><%= $program %>.rb</tt> --- the main <%= $project %> library.
|
42
45
|
|
43
46
|
* <tt><%= $program %>/</tt>
|
44
47
|
|
@@ -51,5 +54,3 @@
|
|
51
54
|
* <tt>index.erb</tt> --- source of this user manual.
|
52
55
|
|
53
56
|
* <tt>LICENSE</tt> --- copyright notice and legal conditions.
|
54
|
-
<% end %>
|
55
|
-
<% end %>
|
data/doc/usage.erb
CHANGED
@@ -1,21 +1,32 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
%#--
|
2
|
+
%# Copyright 2008 Suraj N. Kurapati
|
3
|
+
%# See the LICENSE file for details.
|
4
|
+
%#++
|
4
5
|
|
5
|
-
|
6
|
+
%|chapter "Usage"
|
7
|
+
%|section "Concepts"
|
8
|
+
Client
|
9
|
+
: Any graphical program (a "window") that is running in your X session.
|
6
10
|
|
7
|
-
|
11
|
+
Tag
|
12
|
+
: An arbitrary label that can be associated with one or more clients.
|
8
13
|
|
9
|
-
|
14
|
+
View
|
15
|
+
: A visualization of a particular tag. A "workspace".
|
10
16
|
|
11
|
-
|
17
|
+
Area
|
18
|
+
: A region inside a view. It can contain clients.
|
12
19
|
|
13
|
-
|
20
|
+
Managed area, column
|
21
|
+
: An area whose clients cannot overlap each other.
|
14
22
|
|
15
|
-
|
16
|
-
|
23
|
+
Floating area
|
24
|
+
: An area whose clients:
|
17
25
|
|
18
|
-
|
26
|
+
* can overlap each other
|
27
|
+
* float above clients in the managed areas
|
28
|
+
|
29
|
+
%|section "Command-line interface"
|
19
30
|
When you run this command:
|
20
31
|
|
21
32
|
<%= $program %> --help
|
@@ -24,7 +35,7 @@
|
|
24
35
|
|
25
36
|
<pre><%= verbatim `ruby bin/#{$program} --help` %></pre>
|
26
37
|
|
27
|
-
|
38
|
+
%|paragraph "Interactive shell", "shell"
|
28
39
|
When you run this command:
|
29
40
|
|
30
41
|
<%= $program %>
|
@@ -38,15 +49,14 @@
|
|
38
49
|
For example, to get the current client object, you can type `curr_client` instead of having to type `Rumai.curr_client` at the prompt. Both commands achieve the same effect.
|
39
50
|
|
40
51
|
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.
|
41
|
-
<% end %>
|
42
|
-
<% end %>
|
43
52
|
|
44
|
-
|
45
|
-
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
|
53
|
+
%|section "Tutorial"
|
54
|
+
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.
|
46
55
|
|
47
56
|
<%
|
48
57
|
open_terms = %q{
|
49
58
|
Launch a few terminals so that we have something to work with:
|
59
|
+
|
50
60
|
<code>
|
51
61
|
colors = %w[ red green blue black orange brown gray navy gold ]
|
52
62
|
colors.each {|c| system "xterm -bg #{c} -title #{c} -e read &" }
|
@@ -55,6 +65,7 @@
|
|
55
65
|
|
56
66
|
close_terms = %q{
|
57
67
|
Close the terminals we launched earlier:
|
68
|
+
|
58
69
|
<code>
|
59
70
|
terms = curr_view.clients.select {|c| colors.include? c.label.read }
|
60
71
|
terms.each {|c| c.kill }
|
@@ -62,37 +73,41 @@
|
|
62
73
|
}.gsub(/^\s+/, '')
|
63
74
|
%>
|
64
75
|
|
65
|
-
|
76
|
+
%|section "Automated client arrangement"
|
66
77
|
<%= open_terms %>
|
67
78
|
|
68
79
|
Arrange all clients in a grid:
|
80
|
+
|
69
81
|
<code>
|
70
82
|
curr_view.arrange_in_grid
|
71
83
|
</code>
|
72
84
|
|
73
85
|
Arrange all clients in a diamond shape:
|
86
|
+
|
74
87
|
<code>
|
75
88
|
curr_view.arrange_in_diamond
|
76
89
|
</code>
|
77
90
|
|
78
91
|
Arrange all clients like LarsWM does:
|
92
|
+
|
79
93
|
<code>
|
80
94
|
curr_view.arrange_as_larswm
|
81
95
|
</code>
|
82
96
|
|
83
97
|
<%= close_terms %>
|
84
|
-
<% end %>
|
85
98
|
|
86
|
-
|
99
|
+
%|section "Multiple client grouping"
|
87
100
|
<%= open_terms %>
|
88
101
|
|
89
102
|
Add the red, green, and blue terminals into the "grouping":
|
103
|
+
|
90
104
|
<code>
|
91
105
|
terms = curr_view.clients.select {|c| %w[red green blue].include? c.label.read }
|
92
106
|
terms.each {|c| c.group }
|
93
107
|
</code>
|
94
108
|
|
95
|
-
You should now see a new button labelled as "
|
109
|
+
You should now see a new button labelled as "@" on the left-hand side of wmii's bar, indicating that there is now a new view labelled "@" in wmii. Let us inspect what clients this mysterious view contains:
|
110
|
+
|
96
111
|
<code>
|
97
112
|
v = View.new "@"
|
98
113
|
puts v.clients.map {|c| c.label.read }
|
@@ -101,11 +116,13 @@
|
|
101
116
|
Aha! The mysterious view contains the red, green, and blue clients we recently "grouped". Thus, by adding a client to the "grouping", we are simply tagging the client with the "@" token.
|
102
117
|
|
103
118
|
Now that we have put some clients into the "grouping", let us move all clients in the grouping to the floating area in the current view:
|
119
|
+
|
104
120
|
<code>
|
105
121
|
grouping.each {|c| c.send "toggle" }
|
106
122
|
</code>
|
107
123
|
|
108
124
|
Neat! Let us bring them back into the managed area:
|
125
|
+
|
109
126
|
<code>
|
110
127
|
grouping.each {|c| c.send "toggle" }
|
111
128
|
</code>
|
@@ -115,24 +132,26 @@
|
|
115
132
|
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.
|
116
133
|
|
117
134
|
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.
|
118
|
-
<% end %>
|
119
135
|
|
120
|
-
|
136
|
+
%|section "Easy column manipulation"
|
121
137
|
<%= open_terms %>
|
122
138
|
|
123
139
|
You can insert a group of clients to the top, bottom, or after the currently focused client of _any_ column using Array-like methods.
|
124
140
|
|
125
141
|
Give each client its own column (one client per column):
|
142
|
+
|
126
143
|
<code>
|
127
144
|
curr_view.each_column {|c| c.length = 1 }
|
128
145
|
</code>
|
129
146
|
|
130
147
|
Put (at most) three clients in every column:
|
148
|
+
|
131
149
|
<code>
|
132
150
|
curr_view.each_column {|c| c.length = 3 }
|
133
151
|
</code>
|
134
152
|
|
135
153
|
Move the red, green, and blue clients into the floating area:
|
154
|
+
|
136
155
|
<code>
|
137
156
|
rgb = %w[red green blue]
|
138
157
|
terms = curr_view.clients.select {|c| rgb.include? c.label.read }
|
@@ -140,6 +159,7 @@
|
|
140
159
|
</code>
|
141
160
|
|
142
161
|
Slurp all floating clients into the last column:
|
162
|
+
|
143
163
|
<code>
|
144
164
|
list = curr_view.areas
|
145
165
|
a, b = list.first, list.last
|
@@ -147,59 +167,69 @@
|
|
147
167
|
</code>
|
148
168
|
|
149
169
|
Set the last column's layout to stacking mode:
|
170
|
+
|
150
171
|
<code>
|
151
172
|
b.layout = 'stack'
|
152
173
|
</code>
|
153
174
|
|
154
175
|
Move the red, green, and blue clients to the top of the second column:
|
176
|
+
|
155
177
|
<code>
|
156
178
|
curr_view.areas[2].unshift terms
|
157
179
|
</code>
|
158
180
|
|
159
181
|
Move the red, green, and blue clients to the bottom of the third column:
|
182
|
+
|
160
183
|
<code>
|
161
184
|
curr_view.areas[3].push terms
|
162
185
|
</code>
|
163
186
|
|
164
187
|
<%= close_terms %>
|
165
|
-
<% end %>
|
166
188
|
|
167
|
-
|
189
|
+
%|section "Easy client manipulation"
|
168
190
|
<%= open_terms %>
|
169
191
|
|
170
192
|
Obtain a reference to the red client:
|
193
|
+
|
171
194
|
<code>
|
172
195
|
red = curr_view.clients.find {|c| c.label.read == "red" }
|
173
196
|
</code>
|
174
197
|
|
175
198
|
Show the red client's current tags:
|
199
|
+
|
176
200
|
<code>
|
177
201
|
red.tags
|
178
202
|
</code>
|
179
203
|
|
180
204
|
Add the "foo" and "bar" tags to the red client:
|
205
|
+
|
181
206
|
<code>
|
182
207
|
red.tag "foo", "bar"
|
183
208
|
</code>
|
184
209
|
|
185
210
|
Remove the "bar" tag from the red client:
|
211
|
+
|
186
212
|
<code>
|
187
213
|
red.untag "bar"
|
188
214
|
</code>
|
189
215
|
|
190
216
|
Do complex operations on the red client's tags:
|
217
|
+
|
191
218
|
<code>
|
192
219
|
red.with_tags { concat %w[a b c]; push 'z'; delete 'c' }
|
193
220
|
</code>
|
194
221
|
|
195
222
|
Focus the next client after the red client:
|
223
|
+
|
196
224
|
<code>
|
197
|
-
red.next.focus
|
225
|
+
red.next.focus
|
226
|
+
curr_client == red.next #=> true
|
198
227
|
</code>
|
199
228
|
|
200
229
|
Notice that by focusing a client, we make it the current client.
|
201
230
|
|
202
231
|
Focus the red client on a different view:
|
232
|
+
|
203
233
|
<code>
|
204
234
|
orig = curr_view
|
205
235
|
v = red.views.last
|
@@ -207,40 +237,46 @@
|
|
207
237
|
</code>
|
208
238
|
|
209
239
|
Return to the original view:
|
240
|
+
|
210
241
|
<code>
|
211
242
|
orig.focus
|
212
243
|
</code>
|
213
244
|
|
214
245
|
Send the red client to the last column:
|
246
|
+
|
215
247
|
<code>
|
216
248
|
red.send curr_view.areas.last
|
217
249
|
</code>
|
218
250
|
|
219
251
|
<%= close_terms %>
|
220
|
-
<% end %>
|
221
252
|
|
222
|
-
|
253
|
+
%|section "Traversing the file system"
|
223
254
|
Show the root node of wmii's IXP file system:
|
255
|
+
|
224
256
|
<code>
|
225
257
|
fs
|
226
258
|
</code>
|
227
259
|
|
228
260
|
Show the names of all files at the root level:
|
261
|
+
|
229
262
|
<code>
|
230
263
|
fs.entries
|
231
264
|
</code>
|
232
265
|
|
233
266
|
Show the parent of the root node:
|
267
|
+
|
234
268
|
<code>
|
235
269
|
fs.parent
|
236
270
|
</code>
|
237
271
|
|
238
272
|
Show the children of the root node:
|
273
|
+
|
239
274
|
<code>
|
240
275
|
fs.children
|
241
276
|
</code>
|
242
277
|
|
243
278
|
Navigate into to the <tt>/lbar/</tt> directory:
|
279
|
+
|
244
280
|
<code>
|
245
281
|
n1 = fs.lbar
|
246
282
|
n2 = fs['lbar']
|
@@ -251,6 +287,7 @@
|
|
251
287
|
Notice that you can traverse the file system hierarchy by simply calling methods on node objects. Alternatively, you can traverse by specifying an arbitrary sub-path (relative path) using the `[]` operator on a node.
|
252
288
|
|
253
289
|
Create a new temporary button:
|
290
|
+
|
254
291
|
<code>
|
255
292
|
b = left_bar.rumai_example # path of new button
|
256
293
|
b.exist? #=> false
|
@@ -261,6 +298,7 @@
|
|
261
298
|
You should now see an empty button on the left-hand side of the wmii bar.
|
262
299
|
|
263
300
|
Color the button black-on-white and label it as "hello world":
|
301
|
+
|
264
302
|
<code>
|
265
303
|
content = "#000000 #ffffff #000000 hello world"
|
266
304
|
b.write content
|
@@ -268,18 +306,14 @@
|
|
268
306
|
</code>
|
269
307
|
|
270
308
|
Remove the temporary button:
|
309
|
+
|
271
310
|
<code>
|
272
311
|
b.remove
|
273
312
|
b.exist? #=> false
|
274
313
|
</code>
|
275
|
-
<% end %>
|
276
314
|
|
277
|
-
|
315
|
+
%|section "Available commands"
|
278
316
|
Refer to the `Rumai` module in the [API documentation](api/index.html) for a complete list of commands (method calls, really) and their documentation.
|
279
|
-
<% end %>
|
280
|
-
<% end %>
|
281
317
|
|
282
|
-
|
283
|
-
One important application of
|
284
|
-
<% end %>
|
285
|
-
<% end %>
|
318
|
+
%|section "Scripting your wmiirc", 'wmiirc'
|
319
|
+
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/).
|