Module: Notifier::OsdCat
Instance Method Summary collapse
Instance Method Details
#notify(options) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/notifier/osd_cat.rb', line 9 def notify() color = .fetch(:color, "white") = [:message].inspect.gsub(/!/, "\\!") command = %W[ echo #{} | osd_cat --shadow=0 --colour=#{color} --pos=top --offset=10 --align=center --font=-adobe-helvetica-bold-r-normal-*-*-240-*-*-p-*-*-* --delay=5 --outline=4 ].join(" ") Thread.new { `#{command}` } end |
#supported? ⇒ Boolean
5 6 7 |
# File 'lib/notifier/osd_cat.rb', line 5 def supported? RUBY_PLATFORM =~ /(linux|freebsd)/ && `which osd_cat > /dev/null` && $? == 0 end |