locxter.net

Fixing snap theming on Pop!_OS 22.04

2024-04-21

I know that the snap packaging format is rather controversial and for the most part rightly so (startup times really are a bummer), but unlike Flatpaks and AppImages it has the ability to fully integrate with the system like regular applications from your distributions repositiories, which makes a really handy tool to safely install development tools like Node.js, IntelliJ IDEA or Android Studio and keep them up to date. Unfortunately, some other GTK-based apps I installed didn't manage to pick up my native GTK theme, but once I've understood the cause of this issue, it's actually rather easy to fix...

As you probably know, snap packages are a sandboxed application format by heart, which means that they provide their own environment to run in, which is completely separate from your system files by default. This greatly increases security, makes dependency collisions (different apps requiring different versions of the same library or tool) an issue of the past as multiple versions can coexist and helps to keep your system clean by only placing its files in its dedicated space. However, this strategy also makes nearly all apps unusable by default, since almost all of them require some kind of further interaction with the system than just being allowed to run - this can range from file access to load and store data over network communication to hardware access for serial communcation and the like. The clever solution for this challenge is to provide regulated access via defined, revokable portals, which allows apps to request needed permissions, while keeping the user in full control.

In the snap world such portals are called connections and these also include theming related ones, which explains the lack of proper theming by default. Most apps don't bother to explicitly request the right to access the user's theming and thus look out of place from an UI perspective. Luckily, this can be fixed with the following steps:

With that done, restart your system and all your GTK-based applications should now look perfectly in place on your Pop!_OS installation. Feel free to share your experience with snap theming in the comments down below and have a lovely day...

RSS feed