From a83d0fd28f5a1dce6eed336b7e4e34a0cb50f2d0 Mon Sep 17 00:00:00 2001 From: Hektor Misplon Date: Wed, 5 Feb 2025 00:31:41 +0100 Subject: [PATCH] Update 'setup' script --- .bin/setup | 59 +++++++++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 30 deletions(-) diff --git a/.bin/setup b/.bin/setup index 908d0e0..181b9c3 100755 --- a/.bin/setup +++ b/.bin/setup @@ -1,5 +1,18 @@ #!/bin/bash +# Packages to install from Arch repositories +pac_list=( +git +vim +) + +# Packages to install from AUR +aurpac_list=( +ttf-iosevka-term-ss08 +vim-plug +xbanish +) + install() { if pacman -Qi "$1" &> /dev/null; then echo ""$1" is already installed" @@ -9,20 +22,9 @@ install() { fi } -# Packages to install from Arch repositories -pac_list=( -git -vim -) - -# Packages to install from AUR -aurpac_list=( -xbanish -ttf-iosevka-term-ss08 -) - -# Suckless software to build -suckless_list=( $(ls -1 "$HOME/.suckless/") ) +aurpac() { + git clone "https://aur.archlinux.org/$1.git" "$HOME/.build/$1" +} count=0 @@ -37,37 +39,34 @@ for pac in "${pac_list[@]}" ; do install "$pac"; done +origin="https://git.hektormisplon.xyz/hektor/dots" +git clone "$origin" "$HOME/dots" +cp -r "$HOME/dots/.git" "$HOME/.git" +git --git-dir="$HOME/.git" config --local status.showUntrackedFiles no +git --git-dir="$HOME/.git" stash -m "[dots]" +git --git-dir="$HOME/.git" stash apply +git --git-dir="$HOME/.git" restore "$HOME" + echo " " echo "Installing aur packages" echo " " # [ ] Create aurpac installer function -for aurpac in "${aurpac_list[@]}" ; do +for package in "${aurpac_list[@]}" ; do if pacman -Qi "$1" &> /dev/null; then echo "$1 is already installed" else count=$[count+1] - ("$HOME/.bin/aurpac" "$aurpac" && cd "$aurpac" && makepkg -si) + aurpac "$package" && makepkg -si -D "$HOME/.build/$package" fi done echo " " -echo "Setting up suckless tools" +echo "Setting up NeoVim" echo " " -printf '%s\n' "${suckless_list[@]}" - -# for tool in "${suckless_list[@]}" ; do -# count=$[count+1] -# (cd "$HOME/.suckless/$tool/" && sudo make clean install); -# done - -# echo " " -# echo "Setting up vim" -# echo " " - -# cp .vimrc $HOME/.vimrc -# vim +PlugInstall +git clone --depth=1 https://github.com/savq/paq-nvim.git \ + "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/pack/paqs/start/paq-nvim ## Bluetooth setup # ___