diff --git a/install-sway.sh b/install-sway.sh new file mode 100755 index 0000000..c76ee97 --- /dev/null +++ b/install-sway.sh @@ -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}