IMHO it would help a lot if in the script xdg-su would be set the XDG_RUNTIME_DIR to something more correct: if [ -z "$user" ] ; then XDG_RUNTIME_DIR=/run/user/0 else XDG_RUNTIME_DIR=/run/user/$(id -u "$user") || exit 1 fi export XDG_RUNTIME_DIR short before the final case "$DE" in [...] esac this may work with all the su like commands there out (generic, kde, gnome, xfce, mate, lxde)