A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://rubydoc.info/github/splattael/libnotify/master below:

README – Documentation for splattael/libnotify (master) – RubyDoc.info

Libnotify

Ruby bindings for libnotify using FFI.

Gem | Source | RDoc

Usage Hash Syntax
require 'libnotify'
Libnotify.show(:body => "hello", :summary => "world", :timeout => 2.5)
Block Syntax
require 'libnotify'

n = Libnotify.new do |notify|
  notify.summary    = "hello"
  notify.body       = "world"
  notify.timeout    = 1.5           notify.urgency    = :critical     notify.append     = false         notify.transient  = true          notify.icon_path  = "/usr/share/icons/gnome/scalable/emblems/emblem-default.svg"
end

n.show!
Mixed Syntax
require 'libnotify'

options = {:body => "world", :timeout => 20}
Libnotify.show(options) do |opts|
  opts.timeout = 1.5     end
Managing Icon Paths
require 'libnotify'

Libnotify.icon_dirs << "/usr/share/icons/gnome/*/"
Libnotify.show(:icon_path => "emblem-default.png")
Libnotify.show(:icon_path => :"emblem-default")
Updating existing notification and closing it
n = Libnotify.new(:summary => "hello", :body => "world")
n.update 
Kernel.sleep 1

n.update(:body => "my love") do |notify|
  notify.summary = "goodbye"
end

Kernel.sleep 1

n.close
Installation
gem install libnotify

You'll need libnotify. On Debian just type:

apt-get install libnotify1
Testing
git clone git://github.com/splattael/libnotify.git
cd libnotify
(gem install bundler)
bundle install
rake
Code coverage
COVERAGE=1 rake
Caveats Ubuntu

timeout and append options might not work on Ubuntu. See GH #21 for details. https://github.com/splattael/libnotify/issues/21#issuecomment-19114127

Contributors License

MIT License

TODO

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4