Comment 25 for bug 191264

Revision history for this message
Gerard Louw (gerardlouw) wrote : Quick workaround using script in .bashrc

Here is my quick workaround for this problem, using some bash scripting to create a new command and putting it in your .bashrc file.

Add the following to the bottom of your ~/.bashrc file:

kde4sudo () {
otherargs=""
first=true
for i in $*
do
  if [ $first = true ]
  then
    first=false
  else
    otherargs="$otherargs $i"
  fi
done
kdesudo `which "$1"` $otherargs
}

Then run kde4 applications as root by typing, for example, "kde4sudo dolphin" or "kde4sudo kate /etc/X11/xorg.conf".
This gets rid of the annoyance of having to type the full path each time you wish to run a kde4 application as root.

Note: this will only start functioning in new shells so close open shells or restart to get it fully working.