class Rubiclifier::IdleDetector

Public Class Methods

idle_seconds_threshold() click to toggle source
# File lib/idle_detector.rb, line 9
def self.idle_seconds_threshold
  @idle_seconds_threshold || 120
end
is_idle?() click to toggle source
# File lib/idle_detector.rb, line 13
def self.is_idle?
  Feature.fail_unless_enabled(Feature::IDLE_DETECTION)
  seconds_idle = `/usr/local/sbin/sleepwatcher -g`.to_i / 10
  seconds_idle > idle_seconds_threshold
end
set_idle_seconds_threshold(idle_seconds_threshold) click to toggle source
# File lib/idle_detector.rb, line 5
def self.set_idle_seconds_threshold(idle_seconds_threshold)
  @idle_seconds_threshold = idle_seconds_threshold
end