ubuntu18.04 add a desktop icon for an application

A desktop icon positions

Lniux under desktop icons storage path: / usr / report this content share / Applications

Second, the desktop icon format

All formats are desktop icons desktop, that is called XXX.desktop

Third, the editorial content (common)

// Header (required) 
[Desktop the Entry] 
 
// encoding (optional) 
Encoding = UTF . 8 
 
// program name (must) 
the Name = XXX 
 
// Icon (optional) 
Icon = icon file name (full name path comprising ) 
 
// execute the script (if it is a desktop application icons it certainly is selected) 
Exec = script file path 
 
// classification 
Type = the application 
 
// rollover when prompted for the name of the above 
Comment = comment  

Fourth, the example (to create android studio text icon)

First create a file sudo vim /usr/share/applications/studio.desktop:

[Desktop Entry]
Name=AndroidStudio
Comment=AndroidStudio
Exec=/usr/local/android-studio/bin/studio.sh
Icon=/usr/local/android-studio/bin/studio.png
Terminal=false
Type=Application

ESC back to the command line mode, : WQ Save the file and exit. After saving after cp studio.desktop / home / XX / Desktop OK.

Fifth, the problem arises

Found to occur when you open after creating a good desktop icon: Ubuntu application launcher "androidstudio.desktop" has not been marked as "trusted"  errors.

Solution 1:

Select androidstudio.desktop of Properties -> Permissions -> check "Allow executing file as"

Check to open again appear:

Select trust and launch can be.

 Solution 2:

Permission to modify a file, sent to the desktop icons can not be directly executed, can be modified to perform
chmod +x PyCharm.desktop

 

 

 

Guess you like

Origin www.cnblogs.com/doggod/p/11894947.html