Snaps and themes – on the path to seamless desktop integration

Igor Ljubuncic

on 31 December 2020

Alongside performance, theming is one of the primary concerns for desktop snap users. People expect applications bundled inside snaps to look and behave just like their counterparts shipped and packaged in the traditional way in their Linux distributions, and any discrepancy in this space can lead to a degraded user experience.

Over the years, we have invested a lot of focus in improving the theming integration, but recently, we picked up pace in this area, and we’d like to share a story of our ongoing and future efforts, and set the tone for 2021.

Automatic theme installation for snaps

This project is designed to simplify the usage of new themes in your desktop. In other words, whenever you install and apply a new theme in your system, this change will also propagate to your snaps. This is done by a background service, which will check if the associated theme already exists as a snap, and if not, offer the user the option to install it. With this service in place, you will experience a much tighter integration of snaps in the system, and you will avoid the scenarios where your snaps look different (incorrectly themed) compared to the traditional applications on your host.

Theme snaps

This has probably piqued your curiosity, so the next logical step is to discuss how Linux desktop themes can be packaged as snaps. We already have a nice example to share with you – the TraditionalHumanized theme, a GTK-based theme, available on GitLab.

The example includes the snapcraft.yaml file, which can be used as a recipe for pretty much any other theme. In this particular instance, the theme is designed for use with the MATE desktop, but you can expand it to suit whichever needs you have. It is also worth noting that by default, you will have access to a range of common themes, so that if you’re using standard or stock themes in your Linux desktop, you will most likely already have good integration of themes and snaps. Using the theme snaps, you can expand and complement the common set.


parts:
  theme:
    plugin: dump
    # downloaded from https://www.gnome-look.org/p/1309630/
    source: ./TraditionalHumanized.tar.gz
    Organize:
      gtk-*: share/themes/TraditionalHumanized/
    Stage:
      - share/themes/*/gtk-*
...

Desktop integration

The magic behind the scenes is part of the snapd desktop integration effort. When implemented, the code will provide a user session daemon, which acts as a bridge between the user’s session and snapd, and will be used, among other things, for automatic theme installations. At the moment, the code is work in progress and may yet change – but this is a great opportunity for you to join the effort and contribute! If you’re a theme developer, or you have clever ideas on how to potentially improve the snap look & feel, please submit your own PRs or issues so they can be reviewed and discussed.

Greedy plugs

Finally, the next step in the integration is to allow automatic connection of themes, and allow multiple snaps to connect to them. We aim to achieve this with the proposed greedy plugs. In the future, icon and sounds themes may also be included.

Summary

Seamless theming should make snaps even more fun to use. If you’re a theme developer, you may want to consider the improvements we are introducing in our tooling, and help bring even more art and variety to Linux users in an easy and consistent way. We also welcome feedback, so please join our forum for a discussion, on themes or any other topic.

See you in 2021.

Photo by russn_fckr on Unsplash.

Ubuntu desktop

Learn how the Ubuntu desktop operating system powers millions of PCs and laptops around the world.

Newsletter signup

Select topics you're
interested in

In submitting this form, I confirm that I have read and agree to Canonical's Privacy Notice and Privacy Policy.

Related posts

How to make your first snap

Snaps are a way to package your software so it is easy to install on Linux. If you’re a snap developer already or you’re a part of the Linux community, and...

What’s in a snap?

Snaps are several things, all at once. They are confined, standalone Linux applications that bundle all their necessary dependencies, which means they do not...

How does Ubuntu 16.04 entering Extended Security Maintenance (ESM) affect snap publishers?

At the end of April, Ubuntu 16.04 LTS will reach the end of its five years of mainstream support and enter the Extended Security Maintenance (ESM) phase. If...