#!/bin/sh RMLIST="$HOME/.cache/dwb $HOME/.cache/emacs $HOME/.cache/mutt $HOME/.cache/rtorrent $HOME/.cache/zsh $HOME/.cmus/autosave $HOME/.cmus/cache $HOME/.cmus/lib.pl $HOME/.cmus/playlist.pl $HOME/.cmus/queue.pl $HOME/.cmus/resume $HOME/.cmus/search-history $HOME/.config/gtk-2.0 $HOME/.config/gtk-3.0 $HOME/.config/ranger/bookmarks $HOME/.config/ranger/history $HOME/.config/ranger/tagged $HOME/.fehbg $HOME/.gtk-bookmarks $HOME/.lesshst $HOME/.local/share/newsbeuter $HOME/.local/share/webkit $HOME/.mtap.fuseiso $HOME/.pulse-cookie $HOME/.viminfo $HOME/.w3m $HOME/.zcompdump" RMLIST_CRITICAL=" $HOME/.mutt.pwds.cpt $HOME/.ssh" echo "==> List of files to be removed." echo "$RMLIST" echo echo "==> List of files to be wiped." echo "$RMLIST_CRITICAL" CHOICE="N" echo echo "==> Clean home? [y/N]" read CHOICE CHOICE="$(echo $CHOICE | tr [:lower:] [:upper:])" if [ "$CHOICE" != "Y" ]; then echo "Nothing done." exit fi ## Delete git repo if any. if [ -d "$HOME/.git" ]; then echo echo "==> Cleaning git repo." rm -rf "$HOME/.git" fi ## Delete Dropbox folder if any. if [ -d "$HOME/Dropbox" ] || [ -d "$HOME/.dropbox" ]; then echo echo "==> Cleaning Dropbox folder." rm -rvf "$HOME/Dropbox" rm -rvf "$HOME/.dropbox" fi ## Clean trash if possible. echo echo "==> Emptying trash." if ! command -v trash-empty >/dev/null; then echo ":: 'trash-empty' not installed, you have to clean other drives manually." rm -rvf "$HOME/.local/share/Trash" else trash-empty fi ## Remove data. echo while IFS= read -r i; do rm -rvf "$i" done < Cleaning done."