> Probably you want to use the $XDG_RUNTIME_DIR env variable to find and use > the correct directory. It works beautifully, thanks! Here is the command I am using: ps cax | grep claws-mail > /dev/null if [ $? -eq 0 ]; then sudo -u myusername XDG_RUNTIME_DIR=/run/user/myuid /usr/bin/claws-mail --offline fi