From 97f05263ef490a063a33733d7ea607411a097df8 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Fri, 3 Jul 2020 13:11:03 +0200 Subject: pkgs/profpatsch/xdg-open: Prepare decoding http urls I want to be able to open http(s) links that are e.g. images directly in the right application. Aka web urls should be transparent, instead of always opening everthing in the browser. This adds some silly ways of connecting to the server and parsing out the headers, in order to fetch the content-type. --- pkgs/profpatsch/xdg-open/xdg-open.dhall | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pkgs/profpatsch/xdg-open/xdg-open.dhall') diff --git a/pkgs/profpatsch/xdg-open/xdg-open.dhall b/pkgs/profpatsch/xdg-open/xdg-open.dhall index a7daebe3..03f168c3 100644 --- a/pkgs/profpatsch/xdg-open/xdg-open.dhall +++ b/pkgs/profpatsch/xdg-open/xdg-open.dhall @@ -91,6 +91,10 @@ let xdg-open = set -e file="$1" + mime= + + # match on protocols + # if you want to match files reliably, start with file:// case "$file" in ${prettyLines { indent = 2 -- cgit 1.4.1