Created
March 24, 2022 15:24
-
-
Save mvidner/cda290d029de72c2e6e89d38c7e66e2c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# frozen_string_literal: true | |
require "dbus" | |
# Complex property | |
class Test < DBus::Object | |
dbus_interface "net.vidner.Scratch" do | |
dbus_attr_reader :progress, "(stttt)" | |
end | |
def initialize(opath) | |
@progress = ["working", 1, 0, 100, 42].freeze | |
super(opath) | |
end | |
end | |
bus = DBus::SessionBus.instance | |
svc = bus.request_service("net.vidner.Scratch") | |
svc.export(Test.new("/net/vidner/Scratch")) | |
DBus::Main.new.tap { |m| m << bus }.run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment