--- xdg-su.orig 2012-12-05 20:04:08.040808857 +0100 +++ xdg-su 2012-12-05 20:48:32.384821375 +0100 @@ -425,6 +431,12 @@ if [ -z "${cmd}" ] ; then exit_failure_syntax "command missing" fi +display_user="$user" +[ x"$display_user" = x"" ] && display_user=root +if [ x`whoami` = x"$display_user" ] ; then + exec sh -c "$cmd" +fi + detectDE if [ x"$DE" = x"" ]; then @@ -456,7 +468,6 @@ case "$DE" in ;; *) - [ x"$user" = x"" ] && user=root - exit_failure_operation_impossible "no graphical method available for invoking '$cmd' as '$user'" + exit_failure_operation_impossible "no graphical method available for invoking '$cmd' as '$display_user'" ;; esac