-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
Description
场景:下载的软件,使用sh可以直接运行,想要把这个软件添加到系统菜单中。
示例 下载的截图软件 Snipaste-2.10.8-x86_64.AppImage,使用./Snipaste-2.10.8-x86_64.AppImage 可以启动程序
// 1 移动至 /usr/local/bin 目录内
// 2 创建并写入 .desktop 文件
sudo tee /usr/share/applications/snipaste.desktop > /dev/null <<'EOF'
[Desktop Entry]
Version=1.0
Type=Application
Name=Snipaste
Comment=A powerful screenshot and annotation tool
Exec=/usr/local/bin/Snipaste-2.10.8-x86_64.AppImage
Icon=snipaste
Terminal=false
Categories=Utility;Graphics;
EOF
// 3 赋予正确的权限
sudo chmod 644 /usr/share/applications/snipaste.desktop
示例 给IDEA创建快捷方式
sudo vim /usr/share/applications/idea.desktop
[Desktop Entry]
Version=1.0
Type=Application
Name=IntelliJ IDEA Ultimate
Icon=/home/randy/software/idea-IU-243.28141.18/bin/idea.svg
Exec=/home/randy/software/idea-IU-243.28141.18/bin/idea %f
Comment=The Drive to Develop
Categories=Development;IDE;
Terminal=false
StartupWMClass=jetbrains-idea
StartupNotify=true