Ubuntu | | Add program launcher under Linux

Source: Internet
Author: User
Tags locale

Environment Status:

System: Ubuntu 14.04

GUI Desktop: Unity


I: Create your own shortcut file under the/usr/share/applications/folder:

sudo gedit/usr/share/applications/putty.desktop

II: The contents of the file are as follows: (cannot have extra space before and after)

  1. [Desktop Entry]//Each desktop file starts with this tab, indicating that this is a desktop Entry file
  2. Version = 1.0//Indicates the desktop entry (optional)
  3. Name = Putty//program name (required), here to create a Firefox shortcut for example
  4. Genericname = putty//program generic name (optional)
  5. Comment = Putty GUI//Program description (optional)
  6. Exec =sudo/home/lee/putty-0.67/putty//Program Start command (required), can be run with parameters when the following type is application, this entry is valid
  7. Terminal=true//Use terminal, temporarily only so that the program can follow the root permission to execute
  8. Icon=/home/lee/putty-0.67/icons/putty.ico//Set icon for shortcut (optional)
  9. Terminal = false//whether to run in terminal (optional), when type is application, this entry is valid
  10. Type = Application//desktop (required), common values are "application" and "Link"
  11. Categories = GNOME; Application; Network; Indicate the category that appears in the menu bar (optional)

Reference: http://www.2cto.com/os/201406/306618.html

Detailed Documentation:

Desktop Entry files usually start with the string "[Desktop Entry]". As you can tell from Listing 1, the contents of the Desktop Entry file are made up of several {keyword, value} pairs of Entry. For example, "version" is a keyword, and the keyword "version" corresponds to a value of "1.0". The Desktop Entry file standard defines a range of standard keywords. Standard keywords are required and optional two: Required standard keywords must be defined in the. desktop file, and optional keywords do not. The following is an analysis of key keywords.

  • Keyword "Version": [optional] This value specifies the standard version of the desktop Entry file that is followed by the current desktop Entry file.
  • Keyword "Encoding": [Deprecated Version 1.0] This value specifies the encoding used for a particular string in the current Desktop Entry file. Although the Desktop Entry file Standard 1.0 is no longer recommended for this keyword, the keyword is still widely present in existing desktop Entry files for historical reasons.
  • Keyword "Name": [Required]
  • Keyword "Genericname": [optional]
    This value specifies the common name of the associated application.
  • Keyword "Comment": [optional]
    This value is a simple description of the current desktop entry.
  • Keyword ' Type ': [Required]
    The keyword "type" defines the type of desktop entry file. The common "Type" values are "application" and "Link". "type = Application" means that the current desktop entry file points to an application, whereas "type = Link" means that the current desktop entry file points to a URL (Uniform Resource Locator).
  • Keyword "Exec": [optional]
    The keyword "Exec" only makes sense if the type is "application". The value of "Exec" defines the command to be executed to start the specified application, which is available with parameters.
  • Keyword "URL": [optional]
    The keyword "URL" is only meaningful if the type is "Link". "
  • Keyword "startupnotify": [optional]
    The value of the keyword "Startupnotify" is a Boolean value (True or false). This keyword is only meaningful if the type is "application". The meaning of its value is defined by the specification "Startup Notification Protocol Specifications" [3], which is no longer detailed here.
  • Keyword "Terminal": [optional]
    As with "Startupnotify", the value of the keyword "startupnotify" is also a Boolean value, and the keyword is only meaningful if the "type" type is "Application". The numeric value indicates whether the application (that is, the value of the keyword "Exec") needs to be run in the terminal window.
  • Keyword "Categories": [optional]
    The keyword "Categories" only makes sense if the type is "application". The value of "Categories" indicates the category that the relevant application displays in the menu. Specific menu classifications are defined by the specification "Desktop specification Menu" [4].
  • Keywords "Onlyshowin" and "Notshowin": [optional]
    These two keywords define whether the current desktop entry is displayed under a particular Linux desktop system (for example, Linux GNOME or Linux KDE) (defined by "Onlyshowin") or not (defined by "Notshowin"). For specific definitions, refer to "Desktop specification Menu" [4].
  • Keyword "x-suse-translate": [SuSE Linux specific]
    The keyword "x-suse-translate" is unique to SuSE Linux (http://www.novell.com/linux/). "X-suse-translate" complies with the SuSE RPM package style. The "X-suse-translate" value indicates whether the keyword "Name" and "Genericname" are to be translated. For details, please refer to "SUSE Package Conventions" [5].
  • localization keyword "[LOCALE]"
    Based on the "Desktop Entry Specification" specification [1], the keyword is prefixed with the string "[LOCALE]" to make a specific localization definition for the keyword. The legal value of "LOCALE" is:
    locale= [email protected]

See also: Http://www.ibm.com/developerworks/cn/linux/l-cn-dtef/index.html?ca=drs-cn#ibm-pcon

Ubuntu | | Add program launcher under Linux

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.