Automatic theme snap installation notes

CC’ing @jdstrand and @mpt for their thoughts. It might also be of interest to @gantonayde judging by this thread.

I’ve started working on some code to help with automatic theme installation for snaps, which I’ve uploaded here for now:

At present there is no UI, and it won’t actually install any snaps. It does include the following though:

  1. code to watch changes in the currently selected theme. This makes use of the GtkSettings class, which gives us theme names on both X11 and Wayland desktop sessions. I’m watching the GTK, icon, cursor, and sound themes via this API. The code checks the initial theme selection, and sends a signal whenever the theme is changed (with a 1 second delay in case multiple themes are changed at once).

  2. code to determine whether a set of themes are available to snaps. First it enumerates all content interface slots to determine whether an installed snap provides the theme. Next, it checks whether there are snaps published on the store named after the theme (e.g. gtk-theme-foo for a theme called Foo).

Putting the two together, is a command line program that will check whether your current theme is available to snaps, and repeat this check if the theme is changed. At present it is just logging a warning if there is no snap available for a selected theme, but it would be pretty easy to return that info too.

This is all the work I’d expect such a tool to perform prior to showing any kind of UI to the user. I know @mpt has done some work on what the UI should look like, but there are a few open questions:

  1. The current lookup method of deriving a snap name from the theme name means that there could be four snaps to install (at worst). How much information about each do we want to expose?

  2. As we’re reacting to the theme change after it has happened, is popping up a dialog appropriate? Might a desktop notification fit better?

5 Likes