Compare commits
No commits in common. "a574645fa08e55ecd9da4e66c66fc4aa07e9514d" and "3e71764fd8d70b0a70d55261f7f72946980b55a1" have entirely different histories.
a574645fa0
...
3e71764fd8
121
.bin/setup
121
.bin/setup
|
@ -1,13 +1,13 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Packages to install from Arch repositories
|
||||||
pac_list=(
|
pac_list=(
|
||||||
git
|
git
|
||||||
neovim
|
vim
|
||||||
nodejs-lts-jod
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Packages to install from AUR
|
||||||
aurpac_list=(
|
aurpac_list=(
|
||||||
nvm
|
|
||||||
ttf-iosevka-term-ss08
|
ttf-iosevka-term-ss08
|
||||||
vim-plug
|
vim-plug
|
||||||
xbanish
|
xbanish
|
||||||
|
@ -15,7 +15,7 @@ xbanish
|
||||||
|
|
||||||
install() {
|
install() {
|
||||||
if pacman -Qi "$1" &> /dev/null; then
|
if pacman -Qi "$1" &> /dev/null; then
|
||||||
echo "$1 is already installed"
|
echo ""$1" is already installed"
|
||||||
else
|
else
|
||||||
echo "Installing " "$1"
|
echo "Installing " "$1"
|
||||||
sudo pacman -S --noconfirm --needed "$1"
|
sudo pacman -S --noconfirm --needed "$1"
|
||||||
|
@ -26,93 +26,50 @@ aurpac() {
|
||||||
git clone "https://aur.archlinux.org/$1.git" "$HOME/.build/$1"
|
git clone "https://aur.archlinux.org/$1.git" "$HOME/.build/$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
install_packages() {
|
count=0
|
||||||
announce "Installing packages"
|
|
||||||
local count
|
echo " "
|
||||||
for pac in "${pac_list[@]}" ; do
|
echo "Installing required packages"
|
||||||
count=$((count+1))
|
echo " "
|
||||||
|
|
||||||
|
printf '%s\n' "${pac_list[@]}"
|
||||||
|
|
||||||
|
for pac in "${pac_list[@]}" ; do
|
||||||
|
count=$[count+1]
|
||||||
install "$pac";
|
install "$pac";
|
||||||
done
|
done
|
||||||
echo "$count packages installed"
|
|
||||||
}
|
|
||||||
|
|
||||||
install_dotfiles() {
|
origin="https://git.hektormisplon.xyz/hektor/dots"
|
||||||
announce "Installing dotfiles"
|
git clone "$origin" "$HOME/dots"
|
||||||
origin="https://git.hektormisplon.xyz/hektor/dots"
|
cp -r "$HOME/dots/.git" "$HOME/.git"
|
||||||
git clone "$origin" "$HOME/dots"
|
git --git-dir="$HOME/.git" config --local status.showUntrackedFiles no
|
||||||
cp -r "$HOME/dots/.git" "$HOME/.git"
|
git --git-dir="$HOME/.git" stash -m "[dots]"
|
||||||
git --git-dir="$HOME/.git" config --local status.showUntrackedFiles no
|
git --git-dir="$HOME/.git" stash apply
|
||||||
git --git-dir="$HOME/.git" stash -m "[dots]"
|
git --git-dir="$HOME/.git" restore "$HOME"
|
||||||
git --git-dir="$HOME/.git" stash apply
|
|
||||||
git --git-dir="$HOME/.git" restore "$HOME"
|
|
||||||
}
|
|
||||||
|
|
||||||
install_aur_packages() {
|
echo " "
|
||||||
announce "Installing AUR packages"
|
echo "Installing aur packages"
|
||||||
local count
|
echo " "
|
||||||
for package in "${aurpac_list[@]}" ; do
|
|
||||||
|
# [ ] Create aurpac installer function
|
||||||
|
for package in "${aurpac_list[@]}" ; do
|
||||||
if pacman -Qi "$1" &> /dev/null; then
|
if pacman -Qi "$1" &> /dev/null; then
|
||||||
echo "$1 is already installed"
|
echo "$1 is already installed"
|
||||||
else
|
else
|
||||||
count=$((count+1))
|
count=$[count+1]
|
||||||
aurpac "$package" && makepkg -si -D "$HOME/.build/$package"
|
aurpac "$package" && makepkg -si -D "$HOME/.build/$package"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
echo "$count AUR packages installed"
|
|
||||||
}
|
|
||||||
|
|
||||||
setup_neovim() {
|
echo " "
|
||||||
announce "Setting up NeoVim"
|
echo "Setting up NeoVim"
|
||||||
git clone --depth=1 https://github.com/savq/paq-nvim.git \
|
echo " "
|
||||||
|
|
||||||
|
git clone --depth=1 https://github.com/savq/paq-nvim.git \
|
||||||
"${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/pack/paqs/start/paq-nvim
|
"${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/pack/paqs/start/paq-nvim
|
||||||
}
|
|
||||||
|
|
||||||
setup_keyboard() {
|
## Bluetooth setup
|
||||||
announce "Setting up keyboard"
|
# ___
|
||||||
install "interception-tools"
|
|
||||||
install "interception-caps2esc"
|
|
||||||
udevmon_config_contents="\
|
|
||||||
- JOB: intercept -g \$DEVNODE | caps2esc -m 1 | uinput -d \$DEVNODE
|
|
||||||
DEVICE:
|
|
||||||
EVENTS:
|
|
||||||
EV_KEY: [KEY_CAPSLOCK]"
|
|
||||||
if [ -f /etc/interception/udevmon.yaml ] && diff -q <(echo "$udevmon_config_contents") /etc/interception/udevmon.yaml; then
|
|
||||||
echo "udevmon config already exists"
|
|
||||||
echo "$udevmon_config_contents"
|
|
||||||
elif [ -f /etc/interception/udevmon.yaml ]; then
|
|
||||||
echo "interception udevmon.yaml already exists"
|
|
||||||
cat /etc/interception/udevmon.yaml
|
|
||||||
echo "verify if this config matches the one below"
|
|
||||||
echo "$udevmon_config_contents"
|
|
||||||
else
|
|
||||||
echo "interception udevmon.yaml does not exist, creating one"
|
|
||||||
sudo bash -c "echo '$udevmon_config_contents' > /etc/interception/udevmon.yaml"
|
|
||||||
fi
|
|
||||||
|
|
||||||
sudo systemctl enable --now udevmon.service
|
# - [ ] Check if /etc/pulse/default.pa contains following line
|
||||||
|
# load-module module-switch-on-connect
|
||||||
if pgrep -x caps2esc > /dev/null; then
|
|
||||||
echo "caps2esc is already running"
|
|
||||||
else
|
|
||||||
caps2esc -m 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
announce() {
|
|
||||||
echo " "
|
|
||||||
echo "$1"
|
|
||||||
echo " "
|
|
||||||
}
|
|
||||||
|
|
||||||
confirm() {
|
|
||||||
read -r -p "$1? [y/N]" -n 1
|
|
||||||
case "$REPLY" in y|Y ) "$2";; * ) echo "Skipping"; esac
|
|
||||||
}
|
|
||||||
|
|
||||||
printf '%s\n' "${pac_list[@]}"
|
|
||||||
confirm "Install these packages? " install_packages
|
|
||||||
printf '%s\n' "${aurpac_list[@]}"
|
|
||||||
confirm "Install these AUR packages? " install_aur_packages
|
|
||||||
confirm "Setup NeoVim? " setup_neovim
|
|
||||||
confirm "Install dotfiles? " install_dotfiles
|
|
||||||
confirm "Setup keyboard? " setup_keyboard
|
|
||||||
|
|
|
@ -13,4 +13,3 @@ aliases:
|
||||||
li: issue list
|
li: issue list
|
||||||
al: alias
|
al: alias
|
||||||
al-: alias delete
|
al-: alias delete
|
||||||
version: "1"
|
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
rb = "rebase"
|
rb = "rebase"
|
||||||
rbi = "rebase -i"
|
rbi = "rebase -i"
|
||||||
wt = "worktree"
|
wt = "worktree"
|
||||||
wtc = "config remote.origin.fetch \"+refs/heads/*:refs/remotes/origin/*\""
|
|
||||||
|
|
||||||
[color]
|
[color]
|
||||||
ui = auto
|
ui = auto
|
||||||
|
|
Loading…
Reference in New Issue