#!/bin/bash

#removing previous installed builds and files etc
killall -9 time-champ.-tracker.-electron
killall -9 TimeChamp.Tracker.Electron
killall -9 TimeChamp.AppImage
rm -r ~/.local/share/timechamp
rm -r ~/TimeChampDevDebug
rm -r ~/TimeChamp
rm -r ~/Svcvtt
rm -r timechamp-service.sh
rm -r ~/.cache/tracker
rm -r ~/.local/share/tracker
rm -r ~/.cache/tracker3
rm -r ~/.local/share/tracker3
find ~/.cache -type d -name 'tracker*' -prune -exec rm -rf {} +
find ~/.local/share -type d -name 'tracker*' -prune -exec rm -rf {} +
rm -r ~/.config/time-champ.-tracker.-electron

sudo rm -r /usr/share/icons/custom/timechamp_logo.png
rm -r ~/.local/share/applications/timechampicon.desktop

find ~/Downloads -type d -name 'TimeChamp' -prune -exec rm -rf {} +
find ~/Downloads -type f -name 'TimeChamp.zip' -prune -exec rm -rf {} +

find ~/Downloads -type d -name 'TimeChamp*' -prune -exec rm -rf {} +
find ~/Downloads -type f -name 'TimeChamp*.zip' -prune -exec rm -rf {} +

crontab -u $USER -l | grep -v 'sh ~/.local/share/timechamp/timechamp-service.sh'  | crontab -u $USER -
crontab -u $USER -l | grep -v '~/.local/share/timechamp/timechamp-service ~/.local/share/timechamp/TimeChamp.AppImage'  | crontab -u $USER -
