File: notify.rb

package info (click to toggle)
ruby-dbus 0.25.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 776 kB
  • sloc: ruby: 6,584; xml: 225; sh: 38; makefile: 8
file content (18 lines) | stat: -rwxr-xr-x 379 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env ruby
# frozen_string_literal: true

require "dbus"

if ARGV.size < 2
  puts "Usage:"
  puts "notify.rb \"title\" \"body\""
  exit
end

d = DBus::SessionBus.instance
o = d["org.freedesktop.Notifications"]["/org/freedesktop/Notifications"]

i = o["org.freedesktop.Notifications"]

i.Notify("notify.rb", 0, "info", ARGV[0], ARGV[1], [], {}, 2000) do |ret, param|
end