xdg-settings set default-web-browser chromium-browser.desktop
In searching the desktop file for suitability, it scans for all lines that begin "Exec", and takes the result and packs it into a variable.
If there is exactly one Exec line, this takes out a command name to test for existence, but when more than one matches, the program name is captured as "firstexecprog\nsecondexecprog\nthirdexecprog", and "which" doesn't know how to look up a program like that and the subsequent tests fail.
Output with sh's "-x" option on:
+ grep -E ^Exec(\[[^]=]*])?= /usr/share//applications/chromium-browser.desktop
+ which chromium-browser
+ readlink -f
+ [ ]
+ [ 0 -gt 0 ]
In desktop_file_to_binary and binary_to_desktop_file functions, it makes false assumptions how many times grep may match. Those should treat each Exec match separately.
Created attachment 118501 [details] [review]
desktopfile/binary mapping works for multi-Exec destop files
Patch against git tip to treat each matched line as a separate program.