feat(sway): add script to install sway dotfile

This commit is contained in:
Vincent AROD 2024-11-04 21:28:05 +01:00
parent e3b60d670a
commit 9ba3a15144
1 changed files with 24 additions and 0 deletions

24
install-sway.sh Executable file
View File

@ -0,0 +1,24 @@
#!/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}