Module: Gibil::Notification

Defined in:
lib/gibil.rb

Overview

Uses system notification to notify of current temperature. Currently works/tested only on Linux

Class Method Summary collapse

Class Method Details

.notifyObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/gibil.rb', line 18

def self.notify
  temp = Sensor.temperature

  n = Libnotify.new(
                    summary: 'Temperature',
                    body: "Your computer's temperature is now #{temp} °C",
                    timeout: 1.5,
                    append: true
                    )

  n.urgency = (temp > 80) ? :critical : :normal

  n.show!
end