30 lines
1.1 KiB
Plaintext
30 lines
1.1 KiB
Plaintext
; 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>
|
|
|
|
<require-service <daemon uri_runner>>
|
|
|
|
<daemon uri_runner {
|
|
argv: "uri_runner"
|
|
protocol: text/syndicate
|
|
}>
|
|
|
|
? <service-object <daemon uri_runner> ?cap> [
|
|
$cap [
|
|
<listen-on $root_ds>
|
|
|
|
; 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]>
|
|
]
|
|
]
|