#!/bin/bash
#
#
HELPDIR="/etc/custom/mydebian_helper"
VIMHELPER="myvim.sh"
BASHHELPER="mybash.sh"
MICROTHEME="dracula.micro"

apt update
apt install -y net-tools mc git vim bind9-dnsutils ripgrep fzf curl htop micro || true
apt install -y --no-install-recommends bat ranger || true

#cleanup
rm ${HELPDIR}/${VIMHELPER}
rm ${HELPDIR}/${BASHHELPER}


mkdir -p ${HELPDIR}
cd ${HELPDIR}

wget https://download.al1al7.de/vim/mybash.sh -O ${HELPDIR}/${BASHHELPER}
# use micro as editor
#wget https://download.al1al7.de/vim/vim_config_updater.sh -O ${HELPDIR}/${VIMHELPER}

chmod +x ${HELPDIR}/${BASHHELPER}
chmod +x ${HELPDIR}/${VIMHELPER}

# use micro as editor
#/usr/bin/bash ${HELPDIR}/${VIMHELPER}
/usr/bin/bash ${HELPDIR}/${BASHHELPER}

#Set micro as selected editor
printf '%s\n' "# Generated by custom script" "SELECTED_EDITOR=\"/usr/bin/micro\"" > ~/.selected_editor
mkdir -p ${HELPDIR}/micro/colorschemes
wget https://download.al1al7.de/vim/dracula.micro -O ${HELPDIR}/micro/colorschemes/dracula.micro
wget https://download.al1al7.de/vim/dracula.settings.json -O ${HELPDIR}/micro/settings.json

exit 0

