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:
parent
caae3513a9
commit
2f618d65d5
1 changed files with 4 additions and 9 deletions
|
|
@ -100,19 +100,14 @@ if [ -z "$line" ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
msg info "file is $line"
|
|
||||||
path="$DOWNLOAD_DIR/$line"
|
path="$DOWNLOAD_DIR/$line"
|
||||||
filetype=$(xdg-mime query filetype "$path")
|
|
||||||
application=$(xdg-mime query default "$filetype")
|
|
||||||
|
|
||||||
if [ -z "$application" ]; then
|
msg info "Opening »$line«."
|
||||||
die "Do not know how to open »$line« of type $filetype"
|
|
||||||
fi
|
|
||||||
|
|
||||||
msg info "Opening »$line« (of type $filetype) with ${application%.desktop}"
|
if command -v open >/dev/null 2>&1; then
|
||||||
|
|
||||||
if type open >/dev/null 2>&1; then
|
|
||||||
open "$path" &
|
open "$path" &
|
||||||
|
elif command -v mimeo >/dev/null 2>&1; then
|
||||||
|
mimeo "$path" &
|
||||||
else
|
else
|
||||||
xdg-open "$path" &
|
xdg-open "$path" &
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue