mirror of
https://github.com/PapirusDevelopmentTeam/papirus-icon-theme.git
synced 2025-05-09 05:32:00 -04:00
Make uninstall.sh script interactive
This commit is contained in:
parent
efbba7edaa
commit
0f363f30b5
2 changed files with 37 additions and 5 deletions
|
@ -106,6 +106,8 @@ wget -qO- https://git.io/papirus-icon-theme-install | env DESTDIR="/usr/local/sh
|
|||
|
||||
#### Uninstall
|
||||
|
||||
Use this interactive script to completely remove Papirus icon theme on your system.
|
||||
|
||||
```
|
||||
wget -qO- https://git.io/papirus-icon-theme-uninstall | sh
|
||||
```
|
||||
|
|
40
uninstall.sh
40
uninstall.sh
|
@ -24,12 +24,42 @@ cat <<- EOF
|
|||
|
||||
EOF
|
||||
|
||||
_rm_icon_theme() {
|
||||
test -d "$1" || return 0
|
||||
|
||||
echo "Removing '$1'..." >&2
|
||||
|
||||
if [ -w "$1" ]; then
|
||||
rm -rf "$1"
|
||||
else
|
||||
if command -v sudo >/dev/null; then
|
||||
sudo rm -rf "$1"
|
||||
elif command -v doas >/dev/null; then
|
||||
doas rm -rf "$1"
|
||||
else
|
||||
echo "Failed to remove '$1'. Please run the script with root permission." >&2
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
_yes_no() {
|
||||
printf '%s [Y/n]: ' "$*"
|
||||
read -r yes_no </dev/tty # don't read from stdin
|
||||
|
||||
case "$yes_no" in
|
||||
[Yy]|'') return 0 ;;
|
||||
[Nn]|*) return 1 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
echo "=> Removing $gh_desc ..."
|
||||
for i in ePapirus ePapirus-Dark Papirus Papirus-Adapta Papirus-Adapta-Nokto Papirus-Dark Papirus-Light; do
|
||||
rm -rf "$HOME/.icons/$i"
|
||||
rm -rf "$HOME/.local/share/icons/$i"
|
||||
sudo rm -rf "/usr/local/share/icons/$i"
|
||||
sudo rm -rf "/usr/share/icons/$i"
|
||||
for d in "$HOME/.icons" "$HOME/.local/share/icons" "/usr/local/share/icons" "/usr/share/icons"; do
|
||||
for i in ePapirus ePapirus-Dark Papirus Papirus-Adapta Papirus-Adapta-Nokto Papirus-Dark Papirus-Light; do
|
||||
[ -d "$d/$i" ] || continue
|
||||
if _yes_no "Do you want to remove '$i' from '$d'"; then
|
||||
_rm_icon_theme "$d/$i"
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
echo "=> Done!"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue