diff --git a/src/uri_runner.nim b/src/uri_runner.nim index e4d16f8..48ef719 100644 --- a/src/uri_runner.nim +++ b/src/uri_runner.nim @@ -14,7 +14,6 @@ bootDataspace("main") do (root: Ref; turn: var Turn): connectStdio(root, turn) onPublish(turn, root, ?ActionHandler) do (pat: string; cmd: seq[Assertion]): - # TODO: during if cmd.len < 2: stderr.writeLine "ignoring ", $cmd, " for ", pat else: @@ -24,7 +23,7 @@ bootDataspace("main") do (root: Ref; turn: var Turn): else: stderr.writeLine "not a valid program specification: ", cmd[0] - onPublish(turn, root, ?ListenOn[Ref]) do (a: Assertion): + during(turn, root, ?ListenOn[Ref]) do (a: Assertion): let ds = unembed a onMessage(turn, ds, ?XdgOpen) do (uris: seq[string]): while children.len > 0 and not children.peekFirst.running: @@ -52,5 +51,9 @@ bootDataspace("main") do (root: Ref; turn: var Turn): children.addLast child if not matched: stderr.writeLine "no actions matched for ", uri + do: + # The Syndicate server retracts all assertions when + # the config is rewritten. + actions.setLen 0 runForever() diff --git a/src/xdg_open.nim b/src/xdg_open.nim index fd0fef9..1a594e8 100644 --- a/src/xdg_open.nim +++ b/src/xdg_open.nim @@ -15,10 +15,8 @@ proc mintCap: SturdyRef = var key: array[16, byte] mint(key, "syndicate") -bootDataspace("main") do (ds: Ref; turn: var Turn): - let mainFacet = turn.facet - connectUnix(turn, unixSocketPath(), mintCap()) do (turn: var Turn; a: Assertion) -> TurnAction: - let ds = unembed a +bootDataspace("main") do (root: Ref; turn: var Turn): + connectUnix(turn, unixSocketPath(), mintCap()) do (turn: var Turn; ds: Ref): message(turn, ds, XdgOpen(uris: commandLineParams())) for i in 0..7: poll(20) diff --git a/xdg_open_ng.nimble b/xdg_open_ng.nimble index ae4b6b6..db2eb23 100644 --- a/xdg_open_ng.nimble +++ b/xdg_open_ng.nimble @@ -1,6 +1,6 @@ # Package -version = "0.3.0" +version = "0.3.1" author = "Emery" description = "A better xdg-open" license = "Unlicense" @@ -10,4 +10,4 @@ bin = @[ "uri_runner", "xdg_open"] # Dependencies -requires "nim >= 1.6.4", "syndicate" +requires "nim >= 1.6.4", "syndicate >= 1.3.0"