Some Linux distributions provide a quick way to add a program icon to the desktop, but some distributions may not be available, or just get started with a release, and haven't been found yet. At this point, we can manually add a shortcut to the program icon on the Linux desktop.
The name of the Linux Desktop program icon is "Xxx.desktop", and of course, this file name is not the name of the icon we see on the desktop. The detailed structure of the desktop file, if you want to know, you can refer to this technical article: Linux Desktop Entry file in-depth parsing .
But for ordinary users, we don't need to know so much about technical details. You only need to set three or four of these properties.
Example: The android-studio/bin/directory under the home folder has an SH file, running it will run our androidstudio. But I don't want to run this sh every time I hit a command through a terminal, I want to double-click an icon on my desktop to run Androidstudio, just like a shortcut in Windows.
So you can do this by creating a new normal text document on the desktop where the following is written:
[Desktop Entry] Name=androidstudiotype=applicationicon=/home/android/android-studio/bin/idea.pngexec=sh/home/android/ android-studio/bin/studio.sh
The name represents this desktop shortcut.
type indicates what type of shortcut this is, generally there are two types, andapplication explains that this is a shortcut to an application.
icon represents the path to the file of icons for this shortcut. (this attribute can not be used)
Exec represents the command that will be executed after double-clicking the shortcut.
Another kind of type is Link, which means that this is a shortcut to a URL. If you want to make a link to a URL, in addition to the Type to be set to link , you also need to add a URL attribute, indicating the URL of the link (of course, the above The Exec attribute can be removed), for example:
[Desktop Entry] Name=mecup's Technical Blog type = Linkicon=/home/android/android-studio/bin/idea.pngurl = http://mecup.blog.51cto.com/
save and close the text document and change its file name to "Xxx.desktop" format. However, you may not see it change to the icon we set, but it is still an icon for a normal document, and the name does not become The name that is set in name, such as:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/5B/3A/wKioL1UCsqTDyyO4AAAs9G1CTqY960.jpg "style=" float: none; "title=" 4.png "alt=" Wkiol1ucsqtdyyo4aaas9g1ctqy960.jpg "/>
Double-clicking the icon may not open the program, but will pop up an error message similar to the following:
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/5B/40/wKiom1UCsYKCmkQOAADYuHMVnOs768.jpg "style=" float: none; "title=" 3.png "alt=" Wkiom1ucsykcmkqoaadyuhmvnos768.jpg "/>
At this point, just right-click the shortcut icon, select Properties from the pop-up menu, go to the Properties window and switch to the Permissions tab, and tick allow files to be executed as programs.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/5B/40/wKiom1UCsYKTZQbmAAEHey8rih4295.jpg "style=" float: none; "title=" 1.png "alt=" Wkiom1ucsyktzqbmaaehey8rih4295.jpg "/>
As you can see, the document icon becomes the shortcut icon we set, and the text below becomes the name defined in the Name property, and when you double-click the shortcut, you can open our program normally.
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/5B/3A/wKioL1UCsqOxoQrlAAAggwzBpJg801.jpg "title=" 2.png " Style= "Text-indent:2em;float:none;" alt= "wkiol1ucsqoxoqrlaaaggwzbpjg801.jpg"/>
but this icon of the actual filename, which is still "xxx.desktop".
This article is from the "Mecup Technology blog" blog, make sure to keep this source http://mecup.blog.51cto.com/9989020/1620132
"15.03.13" Manually quickly add a program icon shortcut to the Linux desktop