Module: Rumai

Extended by:
Rumai, ExportInstanceMethods
Includes:
ClientContainer
Included in:
Rumai
Defined in:
lib/rumai/ixp/message.rb,
lib/rumai/wm.rb,
lib/rumai/fs.rb,
lib/rumai/inochi.rb,
lib/rumai/ixp/transport.rb

Overview

Primitives for the 9P2000 protocol.

See cm.bell-labs.com/sys/man/5/INDEX.html See swtch.com/plan9port/man/man9/

Defined Under Namespace

Modules: Chain, ClientContainer, ExportInstanceMethods, IXP, WidgetImpl Classes: Area, Barlet, Client, Node, View, WidgetNode

Constant Summary

IXP_FS_ROOT =
Node.new('/')
FOCUSED_WIDGET_ID =
'sel'.freeze
FLOATING_AREA_ID =
'~'.freeze
CLIENT_GROUPING_TAG =
'@'.freeze
CLIENT_STICKY_TAG =
'/./'.freeze
IXP_SOCK_ADDR =
ENV['WMII_ADDRESS'].sub(/.*!/, '') rescue
"/tmp/ns.#{ENV['USER']}.#{display[/:\d+/]}/wmii"
PROJECT =

Official name of this project.

'Rumai'
TAGLINE =

Short single-line description of this project.

'Ruby interface to the wmii window manager'
WEBSITE =

Address of this project's official home page.

'http://snk.tuxfamily.org/lib/rumai/'
VERSION =

Number of this release of this project.

'4.1.3'
RELDATE =

Date of this release of this project.

'2011-08-21'
INSTDIR =

Location of this release of this project.

File.expand_path('../../..', __FILE__)
GEMDEPS =

RubyGems required by this project during runtime.

Examples:

GEMDEPS = {
  # this project needs exactly version 1.2.3 of the "an_example" gem
  'an_example' => [ '1.2.3' ],

  # this project needs at least version 1.2 (but not
  # version 1.2.4 or newer) of the "another_example" gem
  'another_example' => [ '>= 1.2' , '< 1.2.4' ],

  # this project needs any version of the "yet_another_example" gem
  'yet_another_example' => [],
}
{}

Class Method Summary (collapse)

Instance Method Summary (collapse)

Methods included from ClientContainer

#clients

Class Method Details

+ (Object) inspect

Description of this release of this project.



31
32
33
# File 'lib/rumai/inochi.rb', line 31

def self.inspect
  "#{PROJECT} #{VERSION} (#{RELDATE})"
end

Instance Method Details

- (Object) client_ids

Returns the IDs of the current set of clients.



1231
1232
1233
1234
1235
# File 'lib/rumai/wm.rb', line 1231

def client_ids
  ary = IXP_FS_ROOT.client.entries
  ary.delete FOCUSED_WIDGET_ID
  ary
end

- (Object) curr_area



1245
# File 'lib/rumai/wm.rb', line 1245

def curr_area   ; Area.curr         ; end

- (Object) curr_client


shortcuts for interactive WM manipulation (via IRB)




1241
# File 'lib/rumai/wm.rb', line 1241

def curr_client ; Client.curr       ; end

- (Object) curr_tag



1253
# File 'lib/rumai/wm.rb', line 1253

def curr_tag    ; curr_view.id      ; end

- (Object) curr_view



1249
# File 'lib/rumai/wm.rb', line 1249

def curr_view   ; View.curr         ; end

- (Object) focus_area(id)



1264
1265
1266
# File 'lib/rumai/wm.rb', line 1264

def focus_area id
  Area.focus id
end

- (Object) focus_client(id)



1260
1261
1262
# File 'lib/rumai/wm.rb', line 1260

def focus_client id
  Client.focus id
end

- (Object) focus_view(id)



1268
1269
1270
# File 'lib/rumai/wm.rb', line 1268

def focus_view id
  View.focus id
end

- (Object) fs

Returns the root of IXP file system hierarchy.



1192
1193
1194
# File 'lib/rumai/wm.rb', line 1192

def fs
  IXP_FS_ROOT
end

- (Object) grouping

Returns a list of all grouped clients in the currently focused view. If there are no grouped clients, then the currently focused client is returned in the list.



1218
1219
1220
1221
1222
# File 'lib/rumai/wm.rb', line 1218

def grouping
  list = curr_view.clients.select {|c| c.group? }
  list << curr_client if list.empty? and curr_client.exist?
  list
end

- (Object) next_area



1246
# File 'lib/rumai/wm.rb', line 1246

def next_area   ; curr_area.next    ; end

- (Object) next_client



1242
# File 'lib/rumai/wm.rb', line 1242

def next_client ; curr_client.next  ; end

- (Object) next_tag



1254
# File 'lib/rumai/wm.rb', line 1254

def next_tag    ; next_view.id      ; end

- (Object) next_view



1250
# File 'lib/rumai/wm.rb', line 1250

def next_view   ; curr_view.next    ; end

- (Object) prev_area



1247
# File 'lib/rumai/wm.rb', line 1247

def prev_area   ; curr_area.prev    ; end

- (Object) prev_client



1243
# File 'lib/rumai/wm.rb', line 1243

def prev_client ; curr_client.prev  ; end

- (Object) prev_tag



1255
# File 'lib/rumai/wm.rb', line 1255

def prev_tag    ; prev_view.id      ; end

- (Object) prev_view



1251
# File 'lib/rumai/wm.rb', line 1251

def prev_view   ; curr_view.prev    ; end

- (Object) tags

Returns the current set of tags.



1199
1200
1201
1202
1203
# File 'lib/rumai/wm.rb', line 1199

def tags
  ary = IXP_FS_ROOT.tag.entries.sort
  ary.delete FOCUSED_WIDGET_ID
  ary
end

- (Object) views

Returns the current set of views.



1208
1209
1210
# File 'lib/rumai/wm.rb', line 1208

def views
  tags.map! {|t| View.new t }
end