It is important to note when Ubuntu adds a startup entry for an X-based application:
The wrong approach:
- --------------------------
- #!/bin/sh
- /usr/bin/gtktest& (plus background run)
- --------------------------
So the program is not running after the system starts up.
The right approach:
- ---------------------------
- #!/bin/sh
- Export display=:0.0 (DISPLAY settings are determined by specific circumstances)
- /usr/bin/gtktest& (plus background run)
- ---------------------------
display=:0.0 explanation
: 0 indicates output position, 0 indicates video output to native monitor
The display environment variable format is as follows Host:numa.numb,host refers to Xserver host name or IP address, the graphics will be displayed on this machine, can be started the graphical interface of the Linux/unix machine, can also be installed exceed, X-DEEP/32 and other Windows platforms that run the Xserver windows machine.
If host is empty, it means that Xserver is running natively, and the graphics program (xclient) uses a UNIX socket to connect to Xserver instead of TCP. When you connect using TCP,
NUMA subtracts the value of 6000 for the connected port, and if NUMA is 0, it is connected to port 6000; When you connect using the UNIX socket, the path of the connected UNIX socket is represented, and if 0, the connection is to/tmp/. X11-unix/x0.
Numb is almost always 0.
Ubuntu is the right way to add startup items to an X-based application