Ubuntu is the right way to add startup items to an X-based application

Source: Internet
Author: User

It is important to note when Ubuntu adds a startup entry for an X-based application:

The wrong approach:

    1. --------------------------
    2. #!/bin/sh
    3. /usr/bin/gtktest& (plus background run)
    4. --------------------------

So the program is not running after the system starts up.

The right approach:

    1. ---------------------------
    2. #!/bin/sh
    3. Export display=:0.0 (DISPLAY settings are determined by specific circumstances)
    4. /usr/bin/gtktest& (plus background run)
    5. ---------------------------

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.