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
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue