commit 88deef3f4affa53680382540c2cd1ba9ce8e082d Author: Simon Lees Date: Fri Jun 3 16:45:08 2016 +0930 xdg-mime only return desktop file for existing apps xdg-mime originally returned whatever was in the mimeapps.list file, now it only returns the first desktop file that exists and has a corrosponding binary that exists. fdo#44163 diff --git a/scripts/xdg-mime.in b/scripts/xdg-mime.in index 61b12f1..4b0f2da 100644 --- a/scripts/xdg-mime.in +++ b/scripts/xdg-mime.in @@ -372,8 +372,17 @@ check_mimeapps_list() } ' "$mimeapps_list") if [ -n "$result" ]; then - echo "$result" - exit_success + # $result could be a ; separated list of .desktop files + # use the first on the system + IFS=\; + for app in $result; do + IFS="$oldifs" + exists=$(desktop_file_to_binary "$app") + if [ -n "$exists" ]; then + echo "$app" + exit_success + fi + done fi fi done