i3-config/install.sh

36 lines
1.2 KiB
Bash
Raw Normal View History

2023-09-14 08:01:22 -04:00
#!/bin/bash
export red="\033[1;31m"
export green="\033[1;32m"
export blue="\033[1;34m"
export reset="\033[m"
export check="\xE2\x9C\x93"
export error="\xE2\x9C\x95"
DEPENDENCIES=("/bin/i3" "/bin/i3blocks" "/bin/feh" "/bin/rofi" "/bin/maim" "/bin/dunst")
printf "${blue}[i]${reset} Checking dependencies...\n"
for d in ${DEPENDENCIES[@]}; do
sleep 0.1
which ${d}
if [ "$?" != 0 ]; then
printf "${red}[${error}]${reset} Dependency ${d} not found.\n"
exit 1
fi
done
printf "${blue}[i]${reset} This script will overwrite your current i3 configuration.\n"
read -p "$(printf "${blue}[i]${reset} Continue? [y/n] ")" -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]; then
printf "\n"
cp ${HOME}/.config/i3/config ${HOME}/.config/i3/config.old
printf "${blue}[i]${reset} Saved old configuration as ${HOME}/.config/i3/config.old.\n"
ln -sv config.i3 ${HOME}/.config/i3/config
ln -sv fehbg ${HOME}/.config/i3/fehbg
ln -sv i3blocks ${HOME}/.config/i3blbocks
printf "${blue}[i]${reset} WARNING: Do not delete this directory. This script set up symlinks to this directory. Removing it will effectively uninstall the rice.\n"
printf "${green}[${check}]${reset} Finished.\n"
exit 0
fi