我的桌面文件是:
[Desktop Entry]
Name=Heimer
GenericName=Mind map application
Comment=Mind map application
Exec=heimer
Icon=heimer
Type=Application
Categories=Education;
StartupNotify=true
我的snapcraft.yaml是:
name: heimer
version: '1.1.0'
summary: Heimer is a simple cross-platform mind map tool.
description: |
Heimer is a simple cross-platform mind map creation tool.
Emphasis on easy diagram creation, simplicity, and speed.
grade: stable
confinement: strict
icon: ../../../data/icons/heimer.png
apps:
heimer:
command: desktop-launch heimer
desktop: usr/share/applications/heimer.desktop
plugs: [home, x11, wayland]
parts:
gnu-heimer:
source: ../../../
plugin: cmake
configflags:
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_INSTALL_PREFIX=/usr
build-packages:
- qtbase5-dev
- qttools5-dev
- qttools5-dev-tools
stage-packages:
- libqt5xml5
after: [desktop-qt5]
CMake将应用程序图标安装到:
# Install icons
install(FILES data/icons/heimer.png DESTINATION share/pixmaps)
install(FILES data/icons/heimer.png DESTINATION share/icons/hicolor/64x64/apps)
桌面文件已安装到:
# Install .desktop files
install(FILES ${CMAKE_BINARY_DIR}/heimer.desktop DESTINATION share/applications)
我不明白问题是什么。安装快照后,我的应用程序始终在启动器(Ubuntu 18.04)中显示默认系统图标。创建程序包或运行程序包时,无警告或任何提示。
注意:相同的设置适用于Debian打包。我的Debian软件包使用完全相同的安装位置,并且在这种情况下图标可以正常工作。
答案 0 :(得分:0)
按照这些步骤操作,图标将显示在桌面上(Snap应用程序)