All¹ X11 programs open their windows on the display indicated by the environment variable
sudo -u 1000 env DISPLAY=:0 xev
or for that matter, since you can run programs as a different user from the X server, just
:NUMBER is the notation for local displays; in most scenarios, the X11 server that is running on the console is the one that's started first and ends up being number 0. You can run
echo "$DISPLAY" in a terminal on that display to check whether the display number is correct.
:0.0 is equivalent to
:0 (a trailing
.0 can be omitted).
If you run the program as a different user from the X server, and sometimes even if you run it as the same user, you may need to set the
XAUTHORITY environment variable as well. This variable points to a file that contains a password (called a cookie) that applications must pass to the X server. To see the right value from
echo $XAUTHORITY on that display; if it's unset, the default value is
~ represents the user's home directory.
If you need to find the values of
XAUTHORITY programmatically, see Open a window on a remote X display (why "Cannot open display")?
¹ At least almost all. It's technically possible for them not to, but it takes active work on the part of the programmer to make it not so, whereas a
-display argument is a convention that is far from universal.