Ubuntu adds desktop icons to scripts

This is a small trick, low technical content, but useful, so as a reminder.

Programmers like to use linux development, ubuntu is a common one.

But there is a problem that the ubuntu desktop does not have an application icon by default. Most of us need to add the application script to the PATH environment and then start it with a command.

Is there a faster way, such as opening the application directly by clicking the icon like in windows?

The answer is yes.

Let's take WeChat as an example.

The WeChat on ubuntu is electronic-wechat, which is a package for the web version of WeChat API.

The default startup is a script, I find it too troublesome, so I want to add it directly to the desktop startup bar.

Here are the steps.

1. Create a wechat.desktop file###

To add desktop icons, you need to create a file in the form of xxx.desktop and store the address.

/usr/share/applications

This is suitable for all scripts, we create the WeChat desktop icon, so add wechat.desktop

2. Fill in the content of wechat.desktop###

# File header, fixed format
[ Desktop Entry] 
# coding
Encoding = UTF-8
# Application Name
Name = Wechat
# Application hints, text hints when hovering the icon
Comment = Wechat
# The full path of the application execution script, fill in according to the actual situation
Exec =/home/xxx/xxx/electronic-wechat-linux-x64/electronic-wechat
# Icon address,Specify the icon to be displayed by yourself
Icon =/home/xxx/xxx/wechat.png
# Whether the terminal is started
Terminal =false
# classification
Type = Application

After finishing it, restart it and it will be OK.

Recommended Posts

Ubuntu adds desktop icons to scripts
Windows remote connection to Ubuntu 16.4 desktop
How to upgrade to Ubuntu 20.04
21 essential Ubuntu desktop applications
Remote connection to Ubuntu 19.1
How to upgrade to Ubuntu 20.04
How to Run Tmux Service Scripts on Ubuntu Start Up
Mac uses vnc to remotely log in to the ubuntu16.04 desktop
Ubuntu adds the Chrome icon to the correct posture of the launcher
Upgrade Ubuntu 18.04 on Azure to 18.10
ubuntu7.10 installed to 3D open
Use virtualbox to deploy ubuntu
How to upgrade to Ubuntu 16.04 LTS
ubuntu14.04 sets the desktop to display network speed, cpu information, etc.