The kde-neon extension

This extension helps you snap desktop applications that use Qt5 and/or KDE Frameworks.

How to use it

Add extensions: [kde-neon] to the application definition in your snapcraft.yaml file. See QT5 and KDE Frameworks applications for a complete tutorial on how to use this extension.

apps:
  kcalc:
    extensions:
      - kde-neon
    command: kcalc
    ...

:information_source: If you are using core18 as a base and your application needs access to the Qt5 and KDE Frameworks development tools, add kde-frameworks-5-core18-sdk to the build-snaps of the part that builds your application (this action is not required when using core20 as a base).

What it does

  • It makes the latest Qt5 and KDE Frameworks libraries available to your application at run time.
  • It initialises Qt5 and the desktop environment before your application starts so functionality like fonts, cursor themes and a11y work correctly.

To do this, it connects each application to the following content snaps at run time.

It also configures each application entry with these additional plugs.

For a complete picture of what this extension does, add it to your app definition and run snapcraft expand-extensions.

:information_source: Snapcraft extensions enable snap developers to easily incorporate a set of common requirements into a snap. See Snapcraft extensions for further details.

3 Likes

A notable observation: the kde-frameworks-5-core18 snap ships the KDE Plasma platform theme. The developer may want to prevent loading said theme by setting QT_QPA_PLATFORMTHEME to something not kde for whatever reason, e.g. an incompatibility with the application.

However, the KDE Plasma platform theme will still be loaded if the snap’s being run in a KDE session. The env variables XDG_CURRENT_DESKTOP and KDE_FULL_SESSION affect whether this platform theme is loaded.

A possible solution is to incorporate a wrapper script that unsets said env vars:

if [ ! -z "$KDE_FULL_SESSION" ]; then
  unset KDE_FULL_SESSION
fi

if echo "$XDG_CURRENT_DESKTOP" | grep -q KDE; then
  unset XDG_CURRENT_DESKTOP
fi
1 Like

Thanks! Out of curiosity; what is the reason you use this in your snap?

qelectrotech looks hideous with this theme and also freezes after a while, so the decision was obvious.

1 Like

This does not seem to work on arm64, I suppose because the required kde-frameworks-5-core18 snap is not available on arm64. I filed a bug to note this: https://bugs.launchpad.net/snapcraft/+bug/1881963

3 Likes

The version described above is outdated, the current version that should be used is:

Brilliant, thank you - and thanks for formatting the new link perfectly for copying and pasting!

1 Like

It appears that the core20 and core22 variants support ARM64 as well, as depicted on the store listing page:

Good spot, thanks for letting us know!

1 Like

Please note: Core18 and Core20 is not supported. Until we find a way / manpower to support multiple bases, this is the way of it. Also our current supported setup is core22 -> kf5-5-108-qt-5-15-10-core22-sdk

Thanks

Thanks for the update. I’ve edited the Supported extensions page to reflect this.

1 Like