Class: HackyHAL::DeviceControllers::OsxComputer

Inherits:
GenericSsh show all
Defined in:
lib/hacky_hal/device_controllers/osx_computer.rb

Constant Summary

Constants inherited from GenericSsh

GenericSsh::MAX_COMMAND_RETRIES

Instance Attribute Summary

Attributes inherited from GenericSsh

#host, #ssh_options, #user

Attributes included from Options

#options

Instance Method Summary collapse

Methods inherited from GenericSsh

#connect, #connected?, #disconnect, #exec, #initialize

Methods inherited from Base

#log

Methods included from Options

#[], #initialize

Constructor Details

This class inherits a constructor from HackyHAL::DeviceControllers::GenericSsh

Instance Method Details

#mirror_screensObject

The #mirror_screens and #unmirror_screens methods require the ‘displays’ command line tool to be installed. You can find it here: github.com/bwesterb/displays/



23
24
25
# File 'lib/hacky_hal/device_controllers/osx_computer.rb', line 23

def mirror_screens
  exec("displays mirror")
end

#set_audio_output_device(name) ⇒ Object

The #set_audio_output_device method requires the audiodevice command from “Who’s hacks?”. You can find it here: whoshacks.blogspot.com/2009/01/change-audio-devices-via-shell-script.html



35
36
37
# File 'lib/hacky_hal/device_controllers/osx_computer.rb', line 35

def set_audio_output_device(name)
  exec("audiodevice output '#{name}'")
end

#sleep_displayObject



15
16
17
# File 'lib/hacky_hal/device_controllers/osx_computer.rb', line 15

def sleep_display
  exec("sleep-wake-display sleep")
end

#unmirror_screensObject



27
28
29
# File 'lib/hacky_hal/device_controllers/osx_computer.rb', line 27

def unmirror_screens
  exec("displays unmirror")
end

#wake_displayObject

The #wake_display and #sleep_display methods require the sleep-wake-display command. You can find it here: github.com/byteclub/os-x-sleep-wake-display



11
12
13
# File 'lib/hacky_hal/device_controllers/osx_computer.rb', line 11

def wake_display
  exec("sleep-wake-display wake")
end