diff --git a/dot_local/bin/executable_xdg-https-handler b/dot_local/bin/executable_xdg-https-handler new file mode 100644 index 0000000..f28534d --- /dev/null +++ b/dot_local/bin/executable_xdg-https-handler @@ -0,0 +1,10 @@ +#!/bin/bash +BROWSER=firefox.desktop + +if [[ "$1" =~ ^https?://(www\.)?(youtube\.com/watch|youtu\.be)/ ]]; then + mpv "$1" +elif [[ "$1" =~ ^https?://(www\.)?(youtube\.com/shorts|youtu\.be)/ ]]; then + mpv "$1" +else + gtk-launch "$BROWSER" "$1" +fi diff --git a/dot_local/share/applications/private_xdg-https-handler.desktop b/dot_local/share/applications/private_xdg-https-handler.desktop new file mode 100644 index 0000000..4d45582 --- /dev/null +++ b/dot_local/share/applications/private_xdg-https-handler.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Type=Application +Name=HTTPS Handler +Exec=xdg-https-handler %u +Categroies=Network;WebBrowser; +NoDisplay=true +MimeType=x-scheme-handler/unknown;x-scheme-handler/about;x-scheme-handler/https;x-scheme-handler/http;text/html;text/xml;application/xhtml+xml;