Initial commit
This commit is contained in:
123
setup
Executable file
123
setup
Executable file
@ -0,0 +1,123 @@
|
||||
#!/bin/sh
|
||||
|
||||
declare -a script_deps=(
|
||||
"sed"
|
||||
"git"
|
||||
"sudo"
|
||||
"find"
|
||||
"makepkg"
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
################################################################
|
||||
################################################################
|
||||
################################################################
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
set -e
|
||||
|
||||
exists(){
|
||||
if type "$@" &>/dev/null; then
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
fi
|
||||
}
|
||||
|
||||
for dep in "${script_deps[@]}"; do
|
||||
if ! exists $dep; then
|
||||
echo "'$dep' not found on the system"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
|
||||
if ! exists "yay"; then
|
||||
echo Installing yay...
|
||||
mkdir -p temp
|
||||
cd temp
|
||||
rm -rf yay
|
||||
git clone 'https://aur.archlinux.org/yay.git'
|
||||
cd yay
|
||||
sudo pacman -Sy fakeroot base-devel --noconfirm
|
||||
makepkg -si --noconfirm
|
||||
cd ..
|
||||
rm -rf yay
|
||||
cd ..
|
||||
fi
|
||||
|
||||
|
||||
|
||||
echo Installing packages...
|
||||
yay -Sy --noconfirm `sed 's/^#.*$//' < packages.txt`
|
||||
|
||||
|
||||
|
||||
echo Linking configs...
|
||||
cd config
|
||||
pwd=`pwd`
|
||||
for dir in `find . -type d | sed 's/^\.\///'`; do
|
||||
mkdir -p -v "$HOME/$dir"
|
||||
done
|
||||
for file in `find . -type f | sed 's/^\.\///'`; do
|
||||
#if [ ! -f "$HOME/$file" ]; then
|
||||
ln -s -v -f "$pwd/$file" "$HOME/$file"
|
||||
#fi
|
||||
done
|
||||
cd ..
|
||||
|
||||
|
||||
|
||||
echo Linking scripts...
|
||||
cd scripts
|
||||
pwd=`pwd`
|
||||
mkdir -p -v "$HOME/.local/bin"
|
||||
for script in *; do
|
||||
#if [ ! -f "$HOME/.local/bin/$script" ]; then
|
||||
ln -s -v -f "$pwd/$script" "$HOME/.local/bin/$script"
|
||||
#fi
|
||||
done
|
||||
cd ..
|
||||
|
||||
|
||||
|
||||
echo Installing apps...
|
||||
pwd=`pwd`
|
||||
for app in apps/*; do
|
||||
cd "$app"
|
||||
basename "$app"
|
||||
sh install.sh
|
||||
cd "$pwd"
|
||||
done
|
||||
|
||||
|
||||
|
||||
# Zoxide
|
||||
mkdir -p "$HOME/.config/fish/conf.d"
|
||||
zoxide init fish > "$HOME/.config/fish/conf.d/zoxide.fish"
|
||||
|
||||
# NodeMCU-Tool
|
||||
sudo npm install -g nodemcu-tool
|
||||
|
||||
# Configuring git
|
||||
git config --global core.editor vim
|
||||
git config --global user.name Tomas
|
||||
git config --global user.email tomas@lesbian.ddns.net
|
||||
git config --global credential.helper store
|
||||
git config --global init.defaultBranch master
|
||||
|
||||
# Configure tea
|
||||
tea autocomplete fish
|
||||
tea completion fish > ~/.config/fish/completions/tea.fish
|
||||
|
||||
# Changing shell
|
||||
chsh -s /bin/fish
|
||||
Reference in New Issue
Block a user