From bab8039e9dd0f0e4e82b148ac90e4391831f9284 Mon Sep 17 00:00:00 2001 From: piotr Date: Fri, 28 Jun 2024 01:49:30 +0200 Subject: [PATCH] add uninstall script --- uninstall.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 uninstall.sh diff --git a/uninstall.sh b/uninstall.sh new file mode 100755 index 0000000..277f0a7 --- /dev/null +++ b/uninstall.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +PROGRAM_NAME="nwg-clipman" +MODULE_NAME="nwg_clipman" +SITE_PACKAGES="$(python3 -c "import sysconfig; print(sysconfig.get_paths()['purelib'])")" +PATTERN="$SITE_PACKAGES/$MODULE_NAME*" + +# Remove from site_packages +for path in $PATTERN; do + if [ -e "$path" ]; then + echo "Removing $path" + rm -r "$path" + fi +done + +# Remove launcher script +if [ -f "/usr/bin/$PROGRAM_NAME" ]; then + echo "Removing /usr/bin/$PROGRAM_NAME" + rm "/usr/bin/nwg-clipman" +fi + +echo "Removing icon, .desktop file, license and readme" +rm -f "/usr/share/pixmaps/$PROGRAM_NAME.svg" +rm -f "/usr/share/applications/$PROGRAM_NAME.desktop" +rm -f "/usr/share/licenses/$PROGRAM_NAME/LICENSE" +rm -f "/usr/share/doc/$PROGRAM_NAME/README.md"