I'm working on a script to set some particular gsettings. If the script is being executed as user its working as expected. But, because of some reason I need my script to work with sudo.
One solution i found was to use sudo -u <username> -H ./script
to run it in user space. It is getting executed without any error, but my changes are not taking place in the user space.
I unable to understand what am I missing here. When i run sudo -u <currentUser> -H bach -c `echo " $USER $UID"`
it is working as expected and giving the user values.
What might be the issue here?
Thanks in advance!
What happens: The script is executed with out any error, and says wall paper has been changed. ................
No, I can't see my changes anywhere else.. I'm guessing the changes are being made for 'root'.
– frankenstein Nov 29 '19 at 11:22