shell 应用程序的可执行脚本文件

t9eec4r0  于 7个月前  发布在  Shell
关注(0)|答案(1)|浏览(70)

我有一个脚本文件。我通过给予chmod +x权限使其可执行。我想要一个应用程序图标.单击该图标将运行脚本,文件将输出。我如何才能做到这一点?
我如何才能使它成为一个应用程序?

z31licg0

z31licg01#

To make a script file an application with an icon, you can create a desktop file. A desktop file is a text file that contains information about an application, such as its name, icon, and executable command.

To create a desktop file, follow these steps:

Open a text editor and create a new file.

Type=Application
Terminal=false
Name=YourAppName
Exec=/path/to/script.sh
Icon=/path/to/icon.png

Replace /path/to/script.sh with the path to your script file.

Replace /path/to/icon.png with the path to the icon file that you want to use for your application.

Save the file with a .desktop extension. For example, myapp.desktop

Place the desktop file in the ~/.local/share/applications directory. 

This is the directory that desktop applications are typically installed to.

Once you have created the desktop file, you will be able to launch your application by clicking on the icon in the application menu.

字符串

相关问题