I sort of found a working solution working for one user at a time. It looks like if use:
su user_name bash -c 'gsetting set org.gnome.desktop.interface text-scaling-factor 0.7'
It fails because of:
x11 connection rejected because of wrong authentication
This is because X win cookie is not carried over. So tried the following steps:
root:~#echo $DISPLAY
root output:~#localhost:10.0
root:~#xauth list
output:~#
eglisa-bh/unix:12 MIT-MAGIC-COOKIE-1 9435aa7eb876e2edf3e4f29bbe90f42a
eglisa-bh/unix:10 MIT-MAGIC-COOKIE-1 5e987f3ce693dd4789fgc5c012067f31
root:~#su - student
student:~#DISPLAY=localhost:10.0; export DISPLAY
student:~#xauth add eglisa-bh/unix:10 MIT-MAGIC-COOKIE-1
5e987f3ce693dd4789fgc5c017f31
Does the trick and then by running again:
su user_name bash -c 'gsetting set org.gnome.desktop.interface text-scaling-factor 0.7'
The text scale changes to 0.7 as wanted.
I've tried messing with sudo as well by adding inside the sudoers file:
Defaults env_keep +="DISPLAY XAUTHORIZATION XAUTHORITY"
But this also didn't work. If there is any easier way I would really appreciate it.
/usr/share/glib-2.0/schemas/org.gnome.desktop.interface.gschema.xml
. See examples:ls /usr/share/glib-2.0/schemas/*.gschema.override
– user.dz May 22 '14 at 13:54