File: listnames.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 (19 lines) | stat: -rwxr-xr-x 360 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env ruby
# frozen_string_literal: true

require "dbus"

d = if ARGV.member?("--system")
      DBus::SystemBus.instance
    else
      DBus::SessionBus.instance
    end
d.proxy.ListNames[0].each do |n|
  puts "\t#{n}"
  qns = d.proxy.ListQueuedOwners(n)[0]
  next if qns.size == 1 && qns.first == n

  qns.each do |qn|
    puts "\t\t#{qn}"
  end
end