diff --git a/src/commands/system-setup/4-remove-snaps.sh b/src/commands/system-setup/4-remove-snaps.sh new file mode 100644 index 00000000..c839e4f0 --- /dev/null +++ b/src/commands/system-setup/4-remove-snaps.sh @@ -0,0 +1,28 @@ +#!/bin/sh -e + +. ./common-script.sh + +removeSnaps() { + case $PACKAGER in + pacman) + sudo ${PACKAGER} -Rns snapd + ;; + apt-get|nala) + sudo ${PACKAGER} autoremove --purge snapd + if [ "$ID" = ubuntu ]; then + sudo apt-mark hold snapd + fi + ;; + dnf) + sudo ${PACKAGER} remove snapd + ;; + zypper) + sudo ${PACKAGER} remove snapd + ;; + *) + echo "removing snapd not implemented for this package manager" + esac +} + +checkEnv +removeSnaps diff --git a/src/list.rs b/src/list.rs index 5e094107..e993fa97 100644 --- a/src/list.rs +++ b/src/list.rs @@ -74,6 +74,10 @@ impl CustomList { name: "Global Theme", command: Command::LocalFile("system-setup/3-global-theme.sh"), }, + ListNode { + name: "Remove Snaps", + command: Command::LocalFile("system-setup/4-remove-snaps.sh"), + }, }, ListNode { name: "Security",