DBus notifications with ruby

#!/usr/bin/env ruby # # I'm lazy and want to hold onto this code snippet but don't feel like putting it in subversion # require 'rubygems' require 'rbus' destination = "org.freedesktop.Notifications" object_path = "/org/freedesktop/Notifications" member = "Notify" bus = RBus.session_bus object = bus.get_object(destination, object_path) object.Notify("string:R-Bus", "uint32:0", "string:info", "string:R-Bus Notification", "string:A test example to see that everything works.", "array:string:", "dict:string:variant:", "int32:-1")

Tags: 

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote> <pre>
  • Lines and paragraphs break automatically.
  • Syntax highlight code surrounded by the {syntaxhighlighter SPEC}...{/syntaxhighlighter} tags, where SPEC is a Syntaxhighlighter options string or class="OPTIONS" [title="the title"].

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.