Class: RMonitor::XRandR
- Inherits:
-
Object
- Object
- RMonitor::XRandR
- Defined in:
- lib/rmonitor/xrandr.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ XRandR
constructor
A new instance of XRandR.
- #invoke(*args) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ XRandR
Returns a new instance of XRandR.
3 4 5 6 7 8 |
# File 'lib/rmonitor/xrandr.rb', line 3 def initialize( = {}) @invoker = [:invoker] || Invoker.new() @out = [:out] || $stdout @verbose = [:verbose] @dry_run = [:dry_run] end |
Instance Method Details
#invoke(*args) ⇒ Object
10 11 12 13 14 |
# File 'lib/rmonitor/xrandr.rb', line 10 def invoke(*args) command = ("xrandr " + args.join(" ")).strip @out.puts command if @verbose @invoker.invoke(command) if args.empty? || !@dry_run end |