syndicated-open/handlers-example.pr

30 lines
1.0 KiB
Promela
Raw Permalink Normal View History

2023-05-18 09:46:17 +00:00
; the <exec-space #!> dataspace starts programs when it receives exec messages
? <exec-space ?execspace> [
<action-handler "file://(.*.pdf)" $execspace
<exec ["/run/current-system/sw/bin/mupdf" "$1"]>>
<action-handler "file://(.*.png)" $execspace
<exec ["/run/current-system/sw/bin/imv" "$1"]>>
<action-handler "(magnet:?.*xt=urn:btih.*)" $execspace
<exec ["/run/current-system/sw/bin/transmission-gtk" "$1"]>>
<action-handler "(tg://.*)" $execspace
<exec ["/run/current-system/sw/bin/telegram-desktop" "$1"]>>
<action-handler "https://twitter.com/(.*)" $execspace
<exec ["/run/current-system/sw/bin/firefox" "--new-tab" "https://nitter.net/$1"]>>
<action-handler "(file:///.*.html|http://.*|https://.*)" $execspace
<exec ["/run/current-system/sw/bin/firefox" "$#"]>>
2023-05-18 09:46:17 +00:00
<action-handler "mailto:(.*)" $execspace
<exec ["/run/current-system/sw/bin/astroid" "--mailto" "$#"]>>
2023-05-18 09:46:17 +00:00
]
; when mpv is available send it commands directly
? <mpv ?mpv> [
<action-handler "(.*mp4)|(.*mp3)" $mpv <play-file "$1">>
]