Skip to content

Commit

Permalink
Snap Store: unmark as hidden and reland updates with corrections
Browse files Browse the repository at this point in the history
follows official instructions https://snapcraft.io/docs/installing-snap-on-debian and removes some entirely unnecessary commands
  • Loading branch information
theofficialgman committed Sep 20, 2023
1 parent fe8c679 commit 107075e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
20 changes: 14 additions & 6 deletions apps/Snap Store/install
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,25 @@ fi

sudo snap refresh
sudo systemctl restart snapd.service || error "Unable to restart snapd.service"
sudo modprobe squashfs || exit 1
enable_module squashfs || exit 1

sudo snap install core18 || error "Snapd was unable to install core18"
# install the core snap which obtains the latest snapd
sudo snap install core || error "Snapd was unable to install core"
sudo snap install snapd || error "Snapd was unable to install snapd"

sudo ln -s /var/lib/snapd/snap /snap

echo "Output of 'snap version':"
snap version
sudo snap install snap-store || error "Unable to install snap store"

# correct orphaned directory from older script
sudo rm -rf /usr/share/applications/snap
ln -s /var/lib/snapd/desktop/applications /usr/share/applications/snap || sudo ln -s /var/lib/snapd/desktop/applications /usr/share/applications/snap || error "Failed to create symlink for Snap app shortcuts!"

#Pi-Apps tries to avoid unnecessary reboots at all cost. Snap places desktop launchers in /var/lib/snapd/desktop/applications, which is not searched by default.
#This path is added to $XDG_DATA_DIRS on the next reboot, but we don't want to wait for that!
#If there are files in /var/lib/snapd/desktop/applications, and XDG_DATA_DIRS is missing snap paths, then bind-mount to /usr/share/applications
if [[ "$XDG_DATA_DIRS" != */var/lib/snapd/desktop* ]] && [ ! -z "$(ls /var/lib/snapd/desktop/applications)" ] && [ -z "$(ls /usr/share/applications/snapd-temporary)" ];then
sudo mkdir -p /usr/share/applications/snapd-temporary
sudo mount --bind /var/lib/snapd/desktop/applications /usr/share/applications/snapd-temporary
elif [[ "$XDG_DATA_DIRS" == */var/lib/snapd/desktop* ]] ;then
sudo rm -rf /usr/share/applications/snapd-temporary
fi
#Additionally, PiOS Buster had a bug where XDG_DATA_DIRS was missing snap's entries due to PiOS mods. Pi-Apps fixes this with a runonce.
2 changes: 1 addition & 1 deletion apps/Snap Store/uninstall
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
sudo rm -rf /var/snap/snap-store
sudo rm -rf /var/snap/snap-store /usr/share/applications/snapd-temporary
if command -v snap >/dev/null ;then
sudo snap remove snap-store || error "The snap command failed to uninstall snap-store\nPerhaps running this command would fix it?\nsudo apt install --reinstall snapd"

Expand Down
2 changes: 1 addition & 1 deletion etc/categories
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ Shattered Pixel Dungeon|Games
Shotwell|Creative Arts
SimpleScreenRecorder|Multimedia
Snapdrop|hidden
Snap Store|hidden
Snap Store|Tools
Sonic Pi|Multimedia
SpeedTest-CLI|Internet
Sphero SDK|Programming
Expand Down

0 comments on commit 107075e

Please sign in to comment.