Your submission was sent successfully! Close

You have successfully unsubscribed! Close

Thank you for signing up for our newsletter!
In these regular emails you will find the latest updates about Ubuntu and upcoming events where you can meet our team.Close

Snaps and themes – on the path to seamless desktop integration

Igor Ljubuncic

on 31 December 2020

This article is more than 3 years old.


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

Get the latest Ubuntu news and updates in your inbox.

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

Related posts

Improving snap maintenance with automation

Co-written with Sergio Costas Rodríguez. As the number of snaps increases, the need for automation grows. Any automation to help us maintain a group of snaps...

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

Snapcraft 8.0 and the respectable end of core18

‘E’s not pinin’! ‘E’s passed on! This base is no more! He has ceased to be! ‘E’s expired and gone to meet ‘is maker! ‘E’s a stiff! Bereft of life, ‘e rests in...