From 2f618d65d58f63e2e26b907f19b568601bebb451 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Tue, 18 Mar 2025 11:15:56 +0100 Subject: [PATCH] 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'. --- qutebrowser/scripts/recently-downloaded | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/qutebrowser/scripts/recently-downloaded b/qutebrowser/scripts/recently-downloaded index 19dd925..5e87be9 100755 --- a/qutebrowser/scripts/recently-downloaded +++ b/qutebrowser/scripts/recently-downloaded @@ -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