#!/bin/bash
function fix-su-links {
 for i in $(find $1 -name "*.desktop" -exec grep -ls Exec=$2 {} \;); do
  perl -pi -e "s/(Exec=$2) -- (.*)/\1 \2/" $i
  perl -pi -e "s/(Exec=$2) (.*)/\1 -- \2/" $i
  echo $i fixed
 done
}
fix-su-links /usr/share/applnk kdesu 
