#!/bin/bash

# Check current installation
if [[ -f /usr/local/bin/fontfinder-gtk ]]; then
    echo
    echo "Check current installation ..."
    sleep 0.5
    echo "Remove Fontfinder ..."
    sudo rm /usr/local/bin/fontfinder-gtk
    sudo rm /usr/local/share/applications/fontfinder.desktop
    sudo rm /usr/local/share/fontfinder/version
    if [[  -f /usr/bin/fontfinder-gtk  ]]; then
        echo "Keep icon due other installation found!"
    else
        sudo rm /usr/local/share/icons/fontfinder.*
    fi
    sleep 1
    echo "Done!"
    echo
    exit 0
else
    echo "Check current installation ..."
    sleep 1
    echo "No installation found! Do nothing."
    exit 1
fi
