How to add root to access control list

I want to run some app from root account, and I use xhost +si:localuser:root but is tiresome and I want automate it. But with file is "access control list" and how to add xhost command?
 
Refer to the xhost(1) man page:

Code:
The initial access control list for display number n may be set by the
file /etc/Xn.hosts, where n is the display number of the server. See
Xserver(1) for details.
 
I tried to add si:localuser:root to /etc/X0.hosts, but I still have:
Code:
No protocol specified
Failed to open the X11 display!
 
Back
Top