efreet - improve edstop exec find to use the command with less args
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Sun, 5 Jul 2015 03:53:14 +0000 (12:53 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Sun, 5 Jul 2015 03:53:14 +0000 (12:53 +0900)
commit2f4fb3edac63413ed292ebca43bda79bfea378cb
tree3cfd90cbaa1b86fd26c14432246f379b5dec6015
parente40c223181ec6b46437796809f6c2a7595bfc9bd
efreet - improve edstop exec find to use the command with less args

efreet will just match any desktop file (at random basically -
whatever is first in the list), thjat has the base command looked at.
if you have various desktip files with the same command, like:

mycommand
mycommand %U
mycommand -a -b -c /path/to/file
/usr/bin/mycommand

etc. - which one does it match? it'll pick the first and the list
ordering is arbitrary, so this is pretty bad. this strips off the base
command at the start (full path or whatever) and then uses the command
with the shortest argument length. this means the generic command is
found first if we look for "mycommand" in the above list, whihc ends
up the best... ESPECIALLY for steam which does just this.
src/lib/efreet/efreet_utils.c