module Bluemoon

Constants

VERSION

Public Class Methods

bootup() click to toggle source
# File lib/bluemoon.rb, line 8
def self.bootup
  system "sleepwatcher --displaywakeup 'bluemoon run'"
end
run() click to toggle source
# File lib/bluemoon.rb, line 12
def self.run
  # We disable Bluetooth up here,
  # because disabling it helps us connect to wifi faster
  just_disabled = Bluetooth.off

  if Area.all.any? { |area| area.contains?(Location.current) }
    Bluetooth.on

    just_disabled or  Notify.success('Enabling Bluetooth')
  else
    just_disabled and Notify.success('Disabling Bluetooth')
  end
rescue
  Bluetooth.on
  Notify.handle($!)
end