Auto-connect and greedy plug behaviour for for gtk-common-themes and gtk-theme-traditionalhumanized snaps

I’m making this request in relation to testing automatic theme installation. I’d like two changes:

  • allow any snap to auto connect to gtk-theme-traditionalhumanized's gtk-2-themes and gtk-3-themes slots.
  • update the declaration for gtk-common-themes and gtk-theme-traditionalhumanized snaps to allow greedy connection for their gtk-2-themes and gtk-3-themes slots.

I believe the snap declaration syntax I’m requesting is as follows:

slots:
  content:
    allow-auto-connection:
      -
        plug-attributes:
          content: $SLOT(content)
        slot-attributes:
          content: gtk-2-themes
        slots-per-plug: "*"
      -
        plug-attributes:
          content: $SLOT(content)
        slot-attributes:
          content: gtk-3-themes
        slots-per-plug: "*"

It wouldn’t hurt to update the icon-themes and sound-themes slots on gtk-common-themes too, but these two should be enough to test the feature.

The gtk-theme-traditionalhumanized snap is currently owned by @kenvandine, who is also part of the desktop team.

1 Like

Is there any more information I need to provide for someone to have a look at this?

Ok the request is understood - summarising it here - since we want multiple theme snaps to be able to provide the same content interface (so that we don’t have a single snap gtk-common-themes to provide every possible theme, allowing other themes to be provided as separate snaps) and have them all be auto-connected to the various app snaps that plug this content interface, we need to grant greedy plug behaviour for them all. For now, as a test, this is requested for gtk-common-themes and gtk-theme-traditionalhumanized.

gtk-common-themes already has the auto-connection declaration for its gtk-2-themes and gtk-3-themes slots - so for this we just want the greedy plug declaration added (slots-per-plug: "*").

gtk-theme-traditionalhumanized however does not already have the auto-connection declaration, so for this also needs to be added in this case.

+1 from me for both.

1 Like

Any chance of having this request looked at? This is a necessary prereq for testing whether our scheme for supporting third party theme snaps is workable.

Ok, I reread this request and Auto-connect custom GTK themes to gtk-3-themes, gtk-2-themes and icon-themes.

For this request, I’m +1 to add greedy plugs to gtk-common-themes and +1 to allows auto-connect with greedy plugs to gtk-theme-traditionalhumanized.

The review-tools checks are not in place (see Theme Connector For Snaps classic confinement) so please don’t make updates to suggest auto-downloading theme snaps.

2 votes for, 0 against. This is now live (for both).

1 Like

@jamesh - these have been granted, but there are no corresponding review-tools updates at this time.

If this all works out to plan, I think a tractable easy path forward is to add processes in place for requests that come in when people ask to use greedy plugs with auto-connect for their theme snaps. In this manner, while publishers could upload them, they won’t auto-connect. These processes might include publisher vetting, agreeing to the provided content slots (that would be part of the snap decl of course), requesting that only css, images, etc are shipped, and not shipping any commands, hooks or daemons (ie, your list in Auto-connect custom GTK themes to gtk-3-themes, gtk-2-themes and icon-themes). You could then recommend anything that has a snap declaration that meets your criteria (ie, this request).

We could implement a quick check to prompt for manual review anything that slots any of the slots from gtk-common-themes, but I’m not sure how useful that would be considering the above.

1 Like

FYI, I’ve tentatively updated our processes for content theme snaps for the above. I’ll adjust as necessary depending on the discussion.

1 Like

Thanks for doing this. I can see the updated snap-declaration assertions, and it appears to be behaving as expected. With just gtk-common-themes installed:

$ snap connections snap-store | grep gtk-3-themes
content[gtk-3-themes]     snap-store:gtk-3-themes                   gtk-common-themes:gtk-3-themes   -
$ snap run --shell snap-store
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
$ ls $SNAP/data-dir/themes
Adwaita		   Communitheme-light  Materia-compact
Adwaita-dark	   elementary	       Materia-dark
Ambiance	   Greybird	       Materia-dark-compact
Ambiant-MATE	   Greybird-dark       Materia-light
Ambiant-MATE-Dark  HighContrast        Materia-light-compact
Arc		   Matcha-aliz	       Radiance
Arc-Dark	   Matcha-azul	       Radiant-MATE
Arc-Darker	   Matcha-dark-aliz    Yaru
Breeze		   Matcha-dark-azul    Yaru-dark
Breeze-Dark	   Matcha-dark-sea     Yaru-light
Communitheme	   Matcha-sea
Communitheme-dark  Materia

Now installing gtk-theme-traditionalhumanized:

$ snap install --edge gtk-theme-traditionalhumanized
gtk-theme-traditionalhumanized (edge) 0 from Ken VanDine installed
$ snap connections snap-store | grep gtk-3-themes
content[gtk-3-themes]     snap-store:gtk-3-themes                   gtk-common-themes:gtk-3-themes               -
content[gtk-3-themes]     snap-store:gtk-3-themes                   gtk-theme-traditionalhumanized:gtk-3-themes  -
$ snap run --shell snap-store
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
$ ls $SNAP/data-dir/themes
Adwaita		   Communitheme-light  Materia-compact
Adwaita-dark	   elementary	       Materia-dark
Ambiance	   Greybird	       Materia-dark-compact
Ambiant-MATE	   Greybird-dark       Materia-light
Ambiant-MATE-Dark  HighContrast        Materia-light-compact
Arc		   Matcha-aliz	       Radiance
Arc-Dark	   Matcha-azul	       Radiant-MATE
Arc-Darker	   Matcha-dark-aliz    TraditionalHumanized
Breeze		   Matcha-dark-azul    Yaru
Breeze-Dark	   Matcha-dark-sea     Yaru-dark
Communitheme	   Matcha-sea	       Yaru-light
Communitheme-dark  Materia

And installing a new plug-side snap when both theme snaps are installed:

$ snap install gedit
gedit 3.36.2+git3.8c9da67ab from Canonical✓ installed
$ snap connections gedit | grep gtk-3-themes
content[gtk-3-themes]     gedit:gtk-3-themes     gtk-common-themes:gtk-3-themes               -
content[gtk-3-themes]     gedit:gtk-3-themes     gtk-theme-traditionalhumanized:gtk-3-themes  -

That’s exactly the behaviour I was hoping for.

1 Like