Module: Rumai

Extended by:
Rumai
Includes:
ClientContainer
Included in:
Rumai
Defined in:
lib/rumai/ixp/message.rb,
lib/rumai/fs.rb,
lib/rumai/wm.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 collapse

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

.inspectObject

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

#client_idsObject

Returns the IDs of the current set of clients.



1215
1216
1217
1218
1219
# File 'lib/rumai/wm.rb', line 1215

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

#curr_areaObject



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

def curr_area   ; Area.curr         ; end

#curr_clientObject


shortcuts for interactive WM manipulation (via IRB)




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

def curr_client ; Client.curr       ; end

#curr_tagObject



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

def curr_tag    ; curr_view.id      ; end

#curr_viewObject



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

def curr_view   ; View.curr         ; end

#focus_area(id) ⇒ Object



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

def focus_area id
  Area.focus id
end

#focus_client(id) ⇒ Object



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

def focus_client id
  Client.focus id
end

#focus_view(id) ⇒ Object



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

def focus_view id
  View.focus id
end

#fsObject

Returns the root of IXP file system hierarchy.



1176
1177
1178
# File 'lib/rumai/wm.rb', line 1176

def fs
  IXP_FS_ROOT
end

#groupingObject

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.



1202
1203
1204
1205
1206
# File 'lib/rumai/wm.rb', line 1202

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

#next_areaObject



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

def next_area   ; curr_area.next    ; end

#next_clientObject



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

def next_client ; curr_client.next  ; end

#next_tagObject



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

def next_tag    ; next_view.id      ; end

#next_viewObject



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

def next_view   ; curr_view.next    ; end

#prev_areaObject



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

def prev_area   ; curr_area.prev    ; end

#prev_clientObject



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

def prev_client ; curr_client.prev  ; end

#prev_tagObject



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

def prev_tag    ; prev_view.id      ; end

#prev_viewObject



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

def prev_view   ; curr_view.prev    ; end

#tagsObject

Returns the current set of tags.



1183
1184
1185
1186
1187
# File 'lib/rumai/wm.rb', line 1183

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

#viewsObject

Returns the current set of views.



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

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