hacky_hal 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
data/hacky_hal.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |gem|
4
4
  gem.name = "hacky_hal"
5
- gem.version = "0.2.2"
5
+ gem.version = "0.2.3"
6
6
 
7
7
  gem.authors = ["Nick Ewing"]
8
8
  gem.email = ["nick@nickewing.net"]
@@ -3,6 +3,9 @@ require_relative "generic_ssh"
3
3
  module HackyHAL
4
4
  module DeviceControllers
5
5
  class LinuxComputer < GenericSsh
6
+ # All display methods require the sudo user to have password-less access
7
+ # to run the fgconsole command.
8
+
6
9
  def mirror_screens(source_screen, dest_screen)
7
10
  xrandr_command("--output #{dest_screen} --same-as #{source_screen}")
8
11
  end
@@ -3,14 +3,35 @@ require_relative "generic_ssh"
3
3
  module HackyHAL
4
4
  module DeviceControllers
5
5
  class OsxComputer < GenericSsh
6
+
7
+ # The #wake_display and #sleep_display methods require the
8
+ # sleep-wake-display command. You can find it here:
9
+ # https://github.com/byteclub/os-x-sleep-wake-display
10
+
11
+ def wake_display
12
+ exec("sleep-wake-display wake")
13
+ end
14
+
15
+ def sleep_display
16
+ exec("sleep-wake-display sleep")
17
+ end
18
+
19
+ # The #mirror_screens and #unmirror_screens methods require the 'displays'
20
+ # command line tool to be installed. You can find it here:
21
+ # https://github.com/bwesterb/displays/
22
+
6
23
  def mirror_screens
7
- exec("mirror -on")
24
+ exec("displays mirror")
8
25
  end
9
26
 
10
27
  def unmirror_screens
11
- exec("mirror -off")
28
+ exec("displays unmirror")
12
29
  end
13
30
 
31
+ # The #set_audio_output_device method requires the audiodevice command
32
+ # from "Who's hacks?". You can find it here:
33
+ # http://whoshacks.blogspot.com/2009/01/change-audio-devices-via-shell-script.html
34
+
14
35
  def set_audio_output_device(name)
15
36
  exec("audiodevice output '#{name}'")
16
37
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hacky_hal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-01 00:00:00.000000000 Z
12
+ date: 2013-12-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: upnp-nickewing