manually Create an app shortcut under Ubuntu
In the use of Ubuntu development is always inevitable to install some development software,
So let's talk about how to install the following Ubuntu software:
1.★★★★★
Through the command installation, such as Apt-get,apt-repository,ppa, this does not have any problems, the most convenient and best use, stability is also the best, just need to know in advance the package name of a software, do not know the words will not play, can not be installed, compared to the egg pain. Although the package name can be searched through the Apt-cache Search command, you still need to know the package name, not the name of the package display, and the egg hurts. Software Center has an application can be downloaded, called "New Li de Software Management", the installation of the same effect as the command installation, can be searched by the package name, and then the classification is more, because his principle is through the command installation, performance stability is very good, but even if the search you also need to know the search package name.
2.★★★★☆
Through the Software Center installation, and the source installed through the command is not the same, the effect is not good, the speed stability is not good, the advantages of not need to know the software's English package name, direct search software name Chinese and English are OK. Disadvantage: Stability is not good, even through the software source of the preferences to modify the source of the software, stability performance is still not good, research seems like Software center download is to download the Deb installation package this file, just download does not very good, the installation process is also a comparison card, this problem compared to egg pain.
3.★★★★☆
Download the Deb installation package from other websites, there are many kinds of installation packages, Ubuntu under Deb can be directly double-click installation, software source should be the method of downloading Deb, stability with the command or there is a gap, Deb, the main download no longer use Software Center program to download, The advantage of this is that you can choose other downloads to download, this way you download the number of threads, is random, download speed, stability, and download the completion of the file check, estimated that your downloader should also have, good, nice. Installation process is to go through the Software Center installation, egg pain, the installation process is very card.
4.★★★★☆
Download Gz.zip or Zip compressed package from other website, this is generally green, here only consider not the kind of green download need to install, you can also use the Install program inside to open for installation configuration, or there is a install.sh, The sh suffix file is the shell command file, which performs the installation. The direct command knocks./install.sh executes the sh file.
5.★★★☆☆
Or the same as the above 4 download down is a compressed package, just do not need to install, directly run, you can double-click Open, or just use the command./****sh, run up the program. Then, because the green free installation, may itself is put in some folders, each time to open to find, more trouble!
(这里就不讲怎么用命令怎,解压命令,各种命令怎么玩,还有什么deb怎么用命令安装的,这些东西,其他博客都有,我不想复制粘贴过来,这样子没有意义的,我不是为了赚金币或者装逼而写博客的人。)
Back to the title of the article, I was to write for those who do not have shortcuts in the program to create a shortcut to him, then the question came, the above 5 kinds of installation methods, which are required to create a shortcut, the first 5th because it is green, then must be manually created shortcut, The 4th kind of occasionally meet a few developers is not considered very thoughtful, installed incredibly still no shortcut, Caocaocao, but 123 kinds of almost all have shortcuts, unless they do not have a graphical interface.
Some software first run is prompted to create a shortcut, some are not, some can also run, in the menu bar to find the "Create Desktop Entry" menu, click on this menu can be automatically created.
Here's how to create a manual shortcut:
Shortcut is generally in the/usr/share/applications directory has a xxxxxxxx.desktop file, this file I cut a map!
There is the Exec field in the figure, there are generally three kinds of points, of course, it may be just as far as I know there are three kinds,
- A. Here is a path to the "" symbol package, and the path points to an sh file "" followed by%f
- B. Here is a path to a "" symbol package that points to an executable program
- C. Here is a word consisting of a few letters, just a command such as Gedit
Some of the other fields, such as categories name, are easy to understand and don't talk nonsense.
Look at me and then I'll blow you:
既然这里Exec指向的都是有意义的,那么在此之前我们不管是路径还是命令,都要是有效的,路径的话,我们需要把原来下载好的 东西拷贝到/usr/lib/ 下或者 /usr/local/lib下,或者/opt/ ,总之不要乱放,放的乱七八糟总一天你会一不小心删除了,哈哈哈。
Let's move the folder to the USR Lib directory first! I am here to install Giteye example:
The move was successful.
这里是通过 sudo mv 旧文件夹名 目标目录路径完成
Ok! So let's try to bind the executable to the root of the giteye with a command!
Although it is now possible to create a giteye.desktop directly, let's look at how to bind to the command! Learning is more than learning less strong.
See:
这里通过sudo ln -s 文件路径 /usr/lib/命令名 完成绑定命令指向文件。记住要加sudo 不然蛋疼的权限错误,像我一样。
You take a closer look at the commands above and you'll see that I finally entered the Giteye
Then I must have run up here giteye. Look at the picture:
Ok! We did it.
Then we create our * *. desktop file!
Look at the picture:
这里我是通过 sudo sublime 名称.desktop 来创建文件并编辑的。
Sublime inside because the administrator privileges, you can also use the gedit command instead of my sublime, because Sublime is my own creation of the command, I am more accustomed to use the Sulime tool to write code, write files.
After the save, can we see the icon of our software in the dash?
To search for a keyword in the dash.
Ok! We're done!
The other additions are two diagrams of shortcuts:
Terminal 这里最好是false,这个字段的意思是要不要显示命令窗口,这里一般都是false。
The Name Type Categories is easy to understand, the others I do not know, but some other things can not write Oh, as long as it can be activated.
Copyright NOTICE: This article is original article, if need reprint, please send mail to [email protected] Request BO Master permission reprint.
Manually create an app shortcut under Ubuntu