2022-03-17 19:51:52 +00:00
|
|
|
; Expose a dataspace over a unix socket
|
|
|
|
let ?root_ds = dataspace
|
|
|
|
<require-service <relay-listener <unix "/run/user/1000/dataspace"> $gatekeeper>>
|
|
|
|
<bind "syndicate" #x"" $root_ds>
|
|
|
|
|
2022-02-26 23:39:22 +00:00
|
|
|
<require-service <daemon uri_runner>>
|
|
|
|
|
|
|
|
<daemon uri_runner {
|
2022-03-17 19:51:52 +00:00
|
|
|
argv: "uri_runner"
|
2022-02-26 23:39:22 +00:00
|
|
|
protocol: text/syndicate
|
|
|
|
}>
|
|
|
|
|
|
|
|
? <service-object <daemon uri_runner> ?cap> [
|
2022-05-19 16:58:47 +00:00
|
|
|
|
|
|
|
; send configuration to uri_runner
|
2022-03-19 00:22:31 +00:00
|
|
|
$cap [
|
|
|
|
<listen-on $root_ds>
|
2022-04-15 23:04:37 +00:00
|
|
|
|
|
|
|
; Here the "0" argument is replaced with the whole URI asserted by xdg-open.
|
|
|
|
<action-handler "http://.*|https://.*|.*html", ["/run/current-system/sw/bin/librewolf" 0]>
|
|
|
|
|
|
|
|
; An argument can be a reference to a capture.
|
|
|
|
<action-handler "(tox:.*)|uri:(tox:.*)", ["/run/current-system/sw/bin/qtox" 1]>
|
|
|
|
|
|
|
|
; An argument can contain a reference to a capture using the $i notation.
|
|
|
|
<action-handler "https://twitter.com/(.*)" ["/run/current-system/sw/bin/librewolf" "https://nitter.net/$1"]>
|
|
|
|
|
|
|
|
<action-handler "gemini://.*|file:///.*.gmi" ["/run/current-system/sw/bin/kristall" 0]>
|
|
|
|
<action-handler ".*\\.avi|.*\\.mkv|.*\\.mp4|.*\\.ogg|.*\\.opus", ["/run/current-system/sw/bin/mpv" 0]>
|
2022-05-11 18:06:10 +00:00
|
|
|
|
|
|
|
; filesystem paths are always prefixed with file://
|
|
|
|
<action-handler "file://(.*.pdf)" ["/run/current-system/sw/bin/mupdf" 1]>
|
2022-03-19 00:22:31 +00:00
|
|
|
]
|
2022-05-19 16:58:47 +00:00
|
|
|
|
|
|
|
; uri_runner sends messages to the server to start handler applications
|
|
|
|
$cap ?? <exec ?argv ?restartPolicy> [
|
|
|
|
let ?id = timestamp
|
|
|
|
let ?facet = facet
|
|
|
|
let ?d = <uri_runner-exec $id $argv>
|
|
|
|
$config <run-service <daemon $d>>
|
|
|
|
$config <daemon $d {
|
|
|
|
argv: $argv,
|
|
|
|
readyOnStart: #f,
|
|
|
|
restart: $restartPolicy,
|
|
|
|
}>
|
|
|
|
$config ? <service-state <daemon $d> complete> [$facet ! stop]
|
|
|
|
$config ? <service-state <daemon $d> failed> [$facet ! stop]
|
|
|
|
]
|
|
|
|
|
2022-02-26 23:39:22 +00:00
|
|
|
]
|