awesome_configs/install.sh

23 lines
1.4 KiB
Bash
Raw Normal View History

2021-08-25 05:09:19 +00:00
#!/usr/bin/env sh
deps="7z git tar curl"
for i in $deps; do
if [ -z "$(command -v $i)" ] ; then
echo "Dependency $i NOT met!"
exit
fi
done
2021-08-09 02:36:27 +00:00
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
2021-08-09 03:03:00 +00:00
CACHE_DIR="/tmp/surferlul_awesome"
2021-08-24 20:01:04 +00:00
[ -d "$CACHE_DIR" ] && echo "Removing previous cache" && rm -rf /tmp/surferlul_awesome
2021-08-09 03:03:00 +00:00
mkdir $CACHE_DIR
2021-08-24 20:01:04 +00:00
echo "Downloading AwesomeWM Configs"
2021-08-09 03:03:00 +00:00
git clone https://github.com/Surferlul/awesome.git $CACHE_DIR
2021-08-24 20:01:04 +00:00
[ -d "$HOME/.config/awesome" ] && echo "Backing up previous configs" && tar cf $CACHE_DIR/previous.tar $HOME/.config/awesome/ && echo "Removing previous configs" && rm -rf $HOME/.config/awesome/
echo "Downloading Vicious widgets for AwesomeWM"
2021-08-09 03:03:00 +00:00
git clone https://github.com/vicious-widgets/vicious.git $CACHE_DIR/vicious
2021-08-24 20:01:04 +00:00
echo "Moving configs to install location"
2021-08-09 03:03:00 +00:00
mv $CACHE_DIR $HOME/.config/awesome
2021-08-25 05:09:19 +00:00
[ "$1" != "--preserve-git" ] && echo "Removing git from configs" && rm -rf $HOME/.config/awesome/.git
2021-08-24 20:01:04 +00:00
[ ! -d "$HOME/.fonts" ] && echo "Creating ~/.fonts directory" && mkdir $HOME/.fonts
[ -z "$(ls $HOME/.fonts | grep '[Ii]ndie.*[Ff]lower')" ] && echo "Indie Flower doesn't exist, installing" && mkdir $CACHE_DIR && curl 'https://google-webfonts-helper.herokuapp.com/api/fonts/indie-flower?download=zip&subsets=latin&variants=regular' > $CACHE_DIR/IndieFlower.zip && 7z e -y $CACHE_DIR/IndieFlower.zip -o$CACHE_DIR/ && cp $CACHE_DIR/*.ttf $HOME/.fonts && rm -rf $CACHE_DIR