Class: RMonitor

Inherits:
Object
  • Object
show all
Defined in:
lib/rmonitor.rb,
lib/rmonitor/devices.rb,
lib/rmonitor/version.rb,
lib/rmonitor/profiles.rb,
lib/rmonitor/helpers/dsl_helpers.rb,
lib/rmonitor/helpers/profile_helpers.rb,
lib/rmonitor/helpers/xrandr_read_helpers.rb,
lib/rmonitor/helpers/xrandr_write_helpers.rb

Defined Under Namespace

Modules: DSLHelpers, ProfileHelpers, XRandRReadHelpers, XRandRWriteHelpers Classes: Devices, Profiles, XRandRArgumentError

Constant Summary collapse

VERSION =
'1.0.1'

Class Attribute Summary collapse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw_devices_data, raw_profiles_data) ⇒ RMonitor

Returns a new instance of RMonitor.



15
16
17
18
# File 'lib/rmonitor.rb', line 15

def initialize(raw_devices_data, raw_profiles_data)
  @devices  = Devices.parse(raw_devices_data)
  @profiles = Profiles.parse(raw_profiles_data)
end

Class Attribute Details

.config_pathObject

Returns the value of attribute config_path.



10
11
12
# File 'lib/rmonitor.rb', line 10

def config_path
  @config_path
end

Instance Attribute Details

#devicesObject

Returns the value of attribute devices.



13
14
15
# File 'lib/rmonitor.rb', line 13

def devices
  @devices
end

#profilesObject

Returns the value of attribute profiles.



13
14
15
# File 'lib/rmonitor.rb', line 13

def profiles
  @profiles
end

Class Method Details

.loadObject



20
21
22
# File 'lib/rmonitor.rb', line 20

def self.load
  self.new(`xrandr -q`, File.new(config_path).read)
end