adapted version in snap-desktop