Module: WM
- Defined in:
- lib/epitools/wm.rb
Defined Under Namespace
Class Method Summary collapse
- .current_desktop ⇒ Object
- .desktops ⇒ Object
- .processes ⇒ Object
- .sticky ⇒ Object
- .window(pid) ⇒ Object
- .windows ⇒ Object
Class Method Details
.current_desktop ⇒ Object
11 |
# File 'lib/epitools/wm.rb', line 11 def self.current_desktop; @current ||= desktops.find { |d| d.current? }; end |
.desktops ⇒ Object
9 |
# File 'lib/epitools/wm.rb', line 9 def self.desktops; @desktops ||= Desktop.all; end |
.processes ⇒ Object
10 |
# File 'lib/epitools/wm.rb', line 10 def self.processes; @processes ||= Hash[ Sys.ps.map { |pr| [pr.pid, pr] } ] ; end |
.sticky ⇒ Object
12 |
# File 'lib/epitools/wm.rb', line 12 def self.sticky; @sticky ||= windows.select { |w| w.sticky? }; end |
.window(pid) ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/epitools/wm.rb', line 14 def self.window(pid) results = windows.select { |w| w.pid } if results.empty? # check the children results = windows.select { |w| w.process.children.any? {|pr| pr.pid == pid } } end results end |