Snaps and themes – on the path to seamless desktop integration

by 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.

Newsletter Signup

Related posts

Managing software in complex network environments: the Snap Store Proxy

As enterprises grapple with the evolving landscape of security threats, the need to safeguard internal networks from the broader internet is increasingly important. In environments with restricted internet access, it can be difficult to manage software updates in an easy, reliable way. When managing devices in the field, change management […]

Creating Snaps on Ubuntu Touch

This article was written in collaboration with Alfred E. Neumayer of the UBports Project. Tablets, phones and current technology’s capabilities are phenomenal. Who would have thought a thin, light, barely 10 inch device would provide all the power necessary to run Virtual Machines, wherever one desires while powered on battery? That a sma […]

We wish you RISC-V holidays!

There are three types of computer users: the end user, the system administrator, and the involuntary system administrator. As it happens, everyone has found themselves in the last group at some point or another; you sit down to perform a task relevant to your needs or duties, but suddenly the machine does not work as […]