I have a bash script to check user authentication which sets DISPLAY variable as:
export DISPLAY=:0.0 xhost +local:
After system bootup, at the login screen, this script fails and error is:
xhost: unable to open display ":0.0"
: cannot connect to X server :0.0
After login, the same script works but without any error.
So, how to set the DISPLAY variable properly or am I missing something else?