#!/bin/bash

#get theme files
rm -rf ~/geany-themes
git_clone --depth 1 https://github.com/codebrainz/geany-themes || error "Failed to git_clone the geany themes repository!"

#remove all downloaded themes from .config
files="$(cd ~/geany-themes/colorschemes ; ls)"
#no need for that repo anymore
rm -f ~/geany-themes &>/dev/null

IFS=$'\n'
for file in $files ;do
  rm -f "$HOME/.config/geany/colorschemes/$file"
  sudo rm -f "/usr/share/geany/colorschemes/$file"
done

#clear geany's color_scheme entry
sed -i 's/color_scheme=.*/color_scheme=/g' ~/.config/geany/geany.conf
sudo sed -i 's/color_scheme=.*/color_scheme=/g' /root/.config/geany/geany.conf

exit 0
