meta/config/handlers-example.pr

49 lines
1.6 KiB
Promela

<require-service <daemon uri_runner>>
; 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|.*.jpg|.*.jpeg|.*.qoi)" $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 "(http://.*|https://.*)" $execspace
<exec ["/run/current-system/sw/bin/firefox" "$#"]>>
<action-handler "(file:///.*.html)" $execspace
<exec ["/home/emery/.nix-profile/bin/netsurf-gtk3" "$#"]>>
<action-handler "mailto:(.*)" $execspace
<exec ["/run/current-system/sw/bin/astroid" "--mailto" "mailto:$#"]>>
<action-handler "file://(.*\\.odt)" $execspace
<exec ["/home/emery/.nix-profile/bin/libreoffice" "$#"]>>
<action-handler "file://(.*\\.eris)" $execspace
<exec ["/home/emery/src/bin/erisopen" "$#"]>>
<action-handler "(.*mp4)" $execspace
<exec ["/run/current-system/sw/bin/mpv" "$#"]>>
<action-handler "(.*mkv)" $execspace
<exec ["/run/current-system/sw/bin/mpv" "$#"]>>
]
; when mpv is available send it commands directly
? <mpv ?mpv> [
<action-handler "(.*mp3)" $mpv <play-file "$1">>
<action-handler "(.*wav)" $mpv <play-file "$1">>
]