Executing a script inside snap package. Is this possible?

Just to summarize quickly, my idea and work would allow snaps to offer
content to the classical world. In the particular case I was
interested in, a snap could describe (via an interface) that it wants
to ship a particular set of wallpapers and upon installation they
would become integrated into the classically installed set of
wallpapers.

I built a prototype earlier and, as time permits, I will make changes
to snapd to add this new capability in a way anyone can use.

I share Jamie’s sentiments on the need for a security-sound,
cross-platform interface for setting the current wallpaper. I think
there should be a separate discussion about this with the desktop
environment developers. In absence of agreement we may offer a
snapd-specific interface that acts as a trusted helper and also
translates the request to a particular desktop environment.

Let me know if you are interested in helping out or have more questions.