dotfiles/install-sway.sh

25 lines
475 B
Bash
Executable File

#!/bin/bash
# to be in script folder
cd $(dirname $0)
CURRENT_DIR=$(pwd)
CONFIG_DIR="${HOME}/.config/sway"
CONFIG_FILE="${CONFIG_DIR}/config"
DOTFILE="${CURRENT_DIR}/sway/config"
echo "installing sway"
if [ -f "$CONFIG_FILE" ]
then
echo "backuping existing "
cp $CONFIG_FILE $CONFIG_FILE.bkp
rm $CONFIG_FILE
else
if [ ! -d "$CONFIG_DIR" ]
then
echo "creating ${CONFIG_DIR}"
mkdir $CONFIG_DIR
fi
fi
echo "Linking ${DOTFILE}"
ln -s ${DOTFILE} ${CONFIG_FILE}