Now the command to run commands as another user is simply:
su [user] -c [command]
but I couldn't get that to work for me, atleast until I installed the following package:
sudo apt-get install dbus-x11
now if you run the command from before again (su [user] -c [command]
), it should work like intended. But if it doesn't, run the following:
sudo apt-get install dbus*