class Notiffany::Notifier::Libnotify

System notifications using the [libnotify](github.com/splattael/libnotify) gem.

This gem is available for Linux, FreeBSD, OpenBSD and Solaris and sends system notifications to Gnome [libnotify](developer.gnome.org/libnotify):

Constants

DEFAULTS

Private Instance Methods

_check_available(_opts = {}) click to toggle source
# File lib/notiffany/notifier/libnotify.rb, line 25
def _check_available(_opts = {})
end
_perform_notify(message, opts = {}) click to toggle source

Shows a system notification.

@param [String] message the notification message body @param [Hash] opts additional notification library options @option opts [String] type the notification type. Either ‘success’,

'pending', 'failed' or 'notify'

@option opts [String] title the notification title @option opts [String] image the path to the notification image @option opts [Boolean] transient keep the notifications around after

display

@option opts [Boolean] append append onto existing notification @option opts [Number, Boolean] timeout the number of seconds to display

(1.5 (s), 1000 (ms), false)
# File lib/notiffany/notifier/libnotify.rb, line 42
def _perform_notify(message, opts = {})
  opts = opts.merge(
    summary: opts[:title],
    icon_path: opts[:image],
    body: message,
    urgency: opts[:urgency] || (opts[:type] == "failed" ? :normal : :low)
  )

  ::Libnotify.show(opts)
end
_supported_hosts() click to toggle source
# File lib/notiffany/notifier/libnotify.rb, line 21
def _supported_hosts
  %w(linux linux-gnu freebsd openbsd sunos solaris)
end