在 Fedora 的 GNOME 桌面环境中创建桌面图标(快捷方式)可以通过以下步骤完成。这里以 Eclipse 和 IntelliJ IDEA 为例:
创建 .desktop 文件:
.desktop 文件。例如,为 Eclipse 创建:
bash
nano ~/.local/share/applications/eclipse.desktopbash
nano ~/.local/share/applications/idea.desktop编辑 .desktop 文件内容:
ini
[Desktop Entry]
Name=Eclipse
Type=Application
Exec=/path/to/eclipse/eclipse
Icon=/path/to/eclipse/icon.xpm
Terminal=false
Categories=Development;ini
[Desktop Entry]
Name=IntelliJ IDEA
Type=Application
Exec=/path/to/idea/bin/idea.sh
Icon=/path/to/idea/bin/idea.png
Terminal=false
Categories=Development;/path/to/eclipse 和 /path/to/idea 为实际的安装路径。赋予可执行权限:
chmod +x ~/.local/share/applications/eclipse.desktop
chmod +x ~/.local/share/applications/idea.desktop
复制到桌面:
cp ~/.local/share/applications/eclipse.desktop ~/Desktop/
cp ~/.local/share/applications/idea.desktop ~/Desktop/
eclipse 可执行文件。bin/idea.sh。gnome-desktop-item-edit(如果可用)bash
sudo dnf install gnome-desktop-sharpbash
gnome-desktop-item-edit ~/Desktop/ --create-new/path/to/eclipse/eclipse 或 /path/to/idea/bin/idea.sh).desktop 文件中的 Exec 路径是正确的。Icon 路径是否正确,或使用绝对路径。bash
killall gnome-shell
或注销后重新登录。.desktop 文件有可执行权限。通过以上方法,你可以在 Fedora 的 GNOME 桌面上为 Eclipse 和 IntelliJ IDEA 创建快捷方式。