qutebrowser: Remove xdg-utils dependency from recently-downloaded

First uses the 'open' command if there is one, then the 'mimeo' command
and only then falls back to 'xdg-open'.
This commit is contained in:
Marty Oehme 2025-03-18 11:15:56 +01:00
parent caae3513a9
commit 2f618d65d5
Signed by: Marty
GPG key ID: 4E535BC19C61886E

View file

@ -100,19 +100,14 @@ if [ -z "$line" ]; then
exit 0
fi
msg info "file is $line"
path="$DOWNLOAD_DIR/$line"
filetype=$(xdg-mime query filetype "$path")
application=$(xdg-mime query default "$filetype")
if [ -z "$application" ]; then
die "Do not know how to open »$line« of type $filetype"
fi
msg info "Opening »$line«."
msg info "Opening »$line« (of type $filetype) with ${application%.desktop}"
if type open >/dev/null 2>&1; then
if command -v open >/dev/null 2>&1; then
open "$path" &
elif command -v mimeo >/dev/null 2>&1; then
mimeo "$path" &
else
xdg-open "$path" &
fi