18 lines
445 B
Bash
Executable File
18 lines
445 B
Bash
Executable File
#!/bin/sh
|
|
|
|
echo "Determining MIME type of $1:"
|
|
|
|
MIME=$(curl -I -s "$1" | sed -n -e 's/^[cC]ontent-[tT]ype: //p' | sed -e 's/;.\+//g' | tr -d '\r')
|
|
|
|
echo $MIME
|
|
|
|
BROWSER=$(cat /etc/xdg-sanity.conf | sed -n -e 's/^browser = //p' )
|
|
|
|
# add application/x-xpinstall text/xml application/xhtml+xml x-scheme-handler/https handling
|
|
# fix text/html; charset=utf-8 handling
|
|
if [ "$MIME" = "text/html" ]
|
|
then
|
|
$BROWSER $1
|
|
else
|
|
handlr launch "$MIME" -- "$1"
|
|
fi |