应用程序图标不适用于 Snap 打包

朱兹林

我的桌面文件是:

[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)

我不明白问题是什么。安装 snap 后,我的应用程序始终在启动器(Ubuntu 18.04)中显示默认系统图标。创建包或运行包时没有警告或任何内容。

注意:同样的设置适用于 Debian 打包。我的 Debian 软件包使用完全相同的安装位置,在这种情况下图标工作正常。

林博仁

目前,Snapcraft 不处理桌面条目的图标(因此系统无法找到图标,因为桌面条目中指定的图标不在图标搜索目录中)并且打包者必须手动将Icon修补$SNAP/path/to/the/icon.{png,svg}apps._app_name_.desktop指定的 .desktop 文件

这是

我已在以下位置提交了改善这种情况的提案:提案:apps.<app-name>.icon关键 - snapcraft - snapcraft.io

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章