--- old/xdg-open 2013-11-26 09:59:36.000000000 +0400 +++ new/xdg-open 2013-12-19 19:48:36.000000000 +0400 @@ -571,6 +571,19 @@ command="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | first_word`" command_exec=`which $command 2>/dev/null` arguments="`grep -E "^Exec(\[[^]=]*])?=" "$file" | cut -d= -f 2- | last_word`" + + # handle "%i" field code + if echo $arguments | grep -q '%c' ; then + local name_key="`grep -E "^Name=" "$file" | cut -d= -f 2-`" + arguments="`echo "${arguments}" | sed -e "s*%c*${name_key:-Name}*g"`" + fi + + # handle "%c" field code + if echo $arguments | grep -q '%i' ; then + local icon_key="`grep -E "^Icon(\[[^]=]*])?=" "$file" | cut -d= -f 2- | first_word`" + arguments="`echo "${arguments}" | sed -e "s*%i*${icon_key:+--icon ${icon_key}}*g"`" + fi + arg_one="`echo "$arg" | sed 's/[&*\\]/\\\\&/g'`" arguments_exec="`echo "$arguments" | sed -e 's*%[fFuU]*"'"$arg_one"'"*g'`"