tkinter through VNC without physical display
I asked this question on RaspberryPi Stack Exchange site, and @hildred had a beautiful solution for this:
Write these few lines to etc/sudoers
*:
Defaults env_resetDefaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"Defaults env_keep += "DISPLAY"Defaults env_keep += "XAUTHORITY"
And these few lines to ~/.bashrc
:
if [ -z "$XAUTHORITY" ]; then if [ -e $HOME/.Xauthority ]; then export XAUTHORITY=$HOME/.Xauthority; fi;fi
**On a Raspbian this will be etc/sudoers.d/README
for example*
A person on the Raspberry Pi forums solved a similar problem with tkinter:
A simple work around is to give root the proper authorization to use the X11 connection. Again, within a LXTerminal window:
pi@raspberrypi ~ $ sudo xauth add `xauth list`