【linux】Linux desktop application shortcut

In the Linux system, although many applications have corresponding versions, after downloading, they find that the opening method is not friendly. For example, after downloading DataGrip today, I found these in it after opening the folder: the script in the red box is its
insert image description here
correct the way to open. Each time you have to execute:

./datagrip.sh 

To run this program, very unfriendly.
Of course, if you are a little familiar with linux, you may think: define this path as the environment variable PATH, so that it can run
insert image description hereanywhere ?
sure.
If you are a win user, you may want to create a soft link to something on the desktop to solve this problem. But the opening method here is a shell script, if the soft link is to the desktop, it still has to run.
You can do this:

1. Create a file of type .desktop

 vi /usr/share/applications/x.desktop

document content:

[Desktop Entry]
Name=DataGrip
Exec= /home/zjs/datagrip-2023.2/DataGrip-2023.2/bin/datagrip.sh
Icon= /home/zjs/datagrip-2023.2/DataGrip-2023.2/bin/datagrip.svg
Type=Application
StartupNotify=true

Content analysis:

[Desktop Entry] 文件头
Encoding    编码
Name        应用名称
Name[xx]    不同语言的应用名称
GenericName 描述
Comment 注释
Exec    执行的命令
Icon    图标路径
Terminal    是否使用终端
Type    启动器类型
Categories  应用的类型(内容相关)

After creating the file, modify the permissions:

sudo chmod 744 x.desktop

Note: The permissions must be 744
and then copy a copy to your desktop. Right-click:
insert image description here

Note: If this option does not appear, recheck whether the permission of the following file is 744

insert image description here

Then, the normal icon can appear, and it can be used normally like other software

Guess you like

Origin blog.csdn.net/weixin_43717839/article/details/132080360