This repository has been archived on 2024-09-06. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
sway_config/install.sh

37 lines
799 B
Bash
Executable file

#!/bin/bash
required="sway swayidle swaylock waybar"
BIN_FOLDER="$HOME/.local/bin"
printf "Checking required programs :\n"
for p in $required
do
command -v $p >/dev/null 2>&1 || { printf "\t%s is not installed, bye\n" $p; exit 10; }
printf "\t%s found\n" $p
done
printf "Create symblinks for configurations :\n"
cd conf
while read d
do
printf "\t%s conf folder found\n" $d
rm -rf $HOME/.config/${d%/}
ln -s "$(pwd)/${d%/}" "$HOME/.config/${d%/}"
done < <(ls -d -1 */)
cd ..
printf "Create symblink for executables\n"
if [ ! -d "$BIN_FOLDER" ]
then
printf "\tCreate $BIN_FOLDER\n"
mkdir -p $BIN_FOLDER
fi
cd bin
while read d
do
printf "\t%s script found\n" "$d"
rm -rf $BIN_FOLDER/${d}
ln -s "$(pwd)/${d}" "$BIN_FOLDER/${d}"
done < <(ls -1 *)
exit 0