Class: RMonitor::XRandR

Inherits:
Object
  • Object
show all
Defined in:
lib/rmonitor/xrandr.rb

Instance Method Summary collapse

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(options = {})
  @invoker = options[:invoker] || Invoker.new(options)
  @out = options[:out] || $stdout
  @verbose = options[:verbose]
  @dry_run = options[: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