GNOME Snap Manager extension

Hi,

Currently to be reviewed (unfortunately just after Dash to Panel v40 !):
https://extensions.gnome.org/review/19813

This is a simple popup menu in the top bar to do the usual snap actions. Tell me if you see something to add/change (if it’s not too complicated for me…).

I find it handy. I earn one auto-like. :blush:

Edit: now available through the GNOME Extensions website
https://extensions.gnome.org/extension/3715/snap-manager/
with the new Yaru’s upcoming Snap symbolic icon :wink: .

7 Likes

Neat! I have a couple of suggestions!
snap refresh --list which lists updates before they happen. Handy to see what’s going to update before you actually hit refresh.
snap refresh --time which shows when the next update is due to occur.
snap set system refresh.hold=$(date --iso-8601=seconds -d "60 minutes") (requires sudo / pkexec) - this defers updates for an hour. Could have a set of options like 1 hour, 1 day, 1 week.

1 Like

Here it is:
https://extensions.gnome.org/review/19817
or
https://github.com/fthx/snap-manager

If you think to some other useful commands, you’re welcome. It has to stay somewhat simple because anyone will use directly a terminal for complex stuff?

OK, the extension v2 is now published here:
https://extensions.gnome.org/extension/3715/snap-manager/

BUT I had a nasty surprise (my fault, I should have checked that): your snap set system commands do not work without sudo. The other ones (refresh, install…) do display a nice Gnome Shell password popup, so I was confident. I know that I should never be confident in bash because I’m low-shkilled. So there’s a v3 pending:
https://extensions.gnome.org/review/19820
Edit: already reviewed!

(I’d like to know WHY snap set system do behave not like some other snap commands ? Thanks!)

you shoudl probably ask that to the snapd developers over at forum.snapcraft.io

1 Like
2 Likes

v4 with a proper Refresh submenu (hold refresh, cancel hold, schedule).

https://extensions.gnome.org/review/19847
or
https://github.com/fthx/snap-manager

I asked Yaru team about creating a Snap symbolic icon:
https://github.com/ubuntu/yaru/issues/2403

1 Like

Well, I made a sort of symbolic icon. Being reviewed. Uploaded to github.
edit: community made a nice svg icon, so using it.

2 Likes

@popey

The v8 is reviewed and online. Does the refresh menu match your suggestions? Do you see anything to change/upgrade/add? The “Change channel” item has been refined too with adding available channels.

Ideally I’d like to display results in a nice GS popup but I don’t know how to send these results from terminal output to popup.

1 Like

I introduced an snap updates (snap refresh --list) check at startup (icon turns orange if so).
https://github.com/fthx/snap-manager/blob/4d35fe2e4c7779e0a3c3484210908bf7dcae77bd/extension.js#L108
I’d like to make this part asynchronous to not slowdown GNOME Shell at startup, e.g. for poor/slow internet connections or snap server. Could anybody help me how to do that? I found some promises/async/await stuff but if the solution is quite simple from a JS skilled user?

(My help request for async refresh check is still open :blush: Do you know additonally how to (async of course) wait for network to be available before check for updates?)

Well, I created a startup notification for snap updates:
image

Do you have any comment on this notification (set as CRITICAL, so expanded and persistent) ?
https://extensions.gnome.org/review/download/20445.shell-extension.zip
https://github.com/fthx/snap-manager/blob/master/extension.js

1 Like

Ok I found a workaround in latest v13 to not experience any slowdown when getting the snap refresh list. You have to wait ~ 30s from startup to be notified (timeouts to wait network and refresh command).

@popey or @anybody
Do you know how to check a snap’s permissions before installing it, like Android?

1 Like

@popey @jamesh or anyone!

Until today, I was using my extension with your tricks to hold update (1 month renewable!). So I was notified with snap updates at start-up and everything was fine.
This morning, I renew my snap-resfresh-hold and it just holds it for 3 days.

So, what’s wrong? Did the snapd team change the max hold delay available?

snapd is hard-wired to force refresh after 60 days, no matter how much you defer it.

Argh! Thanks!
I did not correctly understand what you explained to me some time ago. I believed hold was limited to moving 60 days…

So you’re right:

Refresh schedule

timer: 00:00~24:00/4
last: 57 days ago, at 07:49 CET
hold: in 3 days, at 08:49 CEST
next: aujourd'hui à 18h59, heure des Rocheuses (but held)

Could you remove these lines please?

	if holdTime.After(limitTime) {
		return limitTime, nil
	}

It’s for a friend. :yum: