25 lines
475 B
Bash
25 lines
475 B
Bash
|
#!/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}
|