Adds bootstrap.v2

This commit is contained in:
Michel Fedde 2025-04-21 22:19:46 +02:00
parent 06c8003cf2
commit 2bbccb4595
61 changed files with 468 additions and 4 deletions

View file

@ -0,0 +1,13 @@
#!/bin/env sh
class=$(yadm config local.class)
if [[ ! -z $class ]]; then
yadm alt
exit 0
fi
read -p "-- Which class does this device belong to: " -r class
echo "-- Setting class and reloading alternative files"
yadm config local.class $class
yadm alt

View file

@ -0,0 +1,7 @@
#!/bin/env sh
echo "# Refreshing darkman (bruteforce method)"
darkman toggle
darkman toggle
echo "# Reloading hyprland config (sometimes it gets stuck due to yadms alts)"

View file

@ -0,0 +1,108 @@
#!/bin/bash
# Save this file as ~/.config/yadm/bootstrap and make it executable. It will
# execute all executable files (excluding templates and editor backups) in the
# ~/.config/yadm/bootstrap.d directory when run.
_repeat() {
local start=1
local end=${1:-80}
local str="${2:-=}"
local range=$(seq $start $end)
for i in $range; do echo -n "${str}"; done
}
_header() {
local length="$1"
echo -n "/="
_repeat ${length} "="
echo "=\\"
}
_value() {
local value="$1"
echo -n "| "
echo -n ${value}
echo " |"
}
_footer() {
local length="$1"
echo -n "\\="
_repeat ${length} "="
echo "=/"
}
display() {
local value="$1"
_header ${#value}
_value "${value}"
_footer ${#value}
}
runfile() {
local command="$1"
local prompt="Do you wish to run $command? [Ynq]"
local display="Executing $command"
local promptLength=$((${#prompt}))
local displayLength=${#display}
local maxWidth=$((promptLength > displayLength ? promptLength : displayLength))
_header ${maxWidth}
read -p "| $prompt |" -n 1 -r -s
echo
if [[ $REPLY =~ ^[Nn]$ ]]; then
_footer ${maxWidth}
return
fi
if [[ $REPLY =~ ^[Qq]$ ]]; then
_footer ${maxWidth}
display "Exiting..."
exit 0
fi
echo -n "| $display"
_repeat $((maxWidth - displayLength)) " "
echo " |"
_footer ${maxWidth}
if ! "$command"; then
echo "Error: bootstrap '$command' failed" >&2
exit 1
fi
}
set -eu
SCRIPTPATH="$(
cd -- "$(dirname "$0")" >/dev/null 2>&1
pwd -P
)"
# Directory to look for bootstrap executables in
BOOTSTRAP_D="$SCRIPTPATH/bootstrap.d"
$SCRIPTPATH/_set_class.sh
if [[ ! -d "$BOOTSTRAP_D" ]]; then
echo "Error: bootstrap directory '$BOOTSTRAP_D' not found" >&2
exit 1
fi
declare -a bootstraps
while IFS= read -r bootstrap; do
if [[ -x "$bootstrap" && ! "$bootstrap" =~ "##" && ! "$bootstrap" =~ ~$ && ! "$bootstrap" =~ ".bak" ]]; then
bootstraps+=("$bootstrap")
fi
done < <(find -L "$BOOTSTRAP_D" -type f | sort)
for bootstrap in "${bootstraps[@]}"; do
runfile "$bootstrap"
done
"$SCRIPTPATH/apply_changes"
display "Bootstrap completed"

View file

@ -0,0 +1,3 @@
#!/bin/env sh
yay

View file

@ -0,0 +1,11 @@
#!/bin/env bash
echo "Installing general apps"
yay -S --needed neovim \
network-manager-applet \
ghostty \
btop \
zoxide fzf \
wifi-qr \
brightnessctl

View file

@ -0,0 +1,6 @@
#!/bin/env sh
yay -S --needed \
mesa lib32-mesa \
xf86-video-amdgpu \
vulkan-radeon lib32-vulkan-radeon

View file

@ -0,0 +1,6 @@
#!/bin/env sh
yay -S --needed bluez \
bluez-utils
sudo systemctl enable --now bluetooth.service

View file

@ -0,0 +1,8 @@
#!/bin/env sh
yay -S --needed sddm catppuccin-sddm-theme-mocha
sudo mkdir -p /etc/sddm.conf.d
sudo ln ~/.config/sddm/theme.conf /etc/sddm.conf.d/theme.conf
sudo systemctl enable sddm

View file

@ -0,0 +1,35 @@
#!/bin/env bash
if [ -z ${XDG_SESSION_DESKTOP+x} ]; then
read -p "Which desktop environment do you want to install? " -r XDG_SESSION_DESKTOP
fi
echo "Installing dependencies for $XDG_SESSION_DESKTOP"
if [ $XDG_SESSION_DESKTOP = "i3" ]; then
yay -S --needed polybar \
betterlockscreen \
dunst \
pulseaudio-control \
nitrogen
fi
if [ $XDG_SESSION_DESKTOP = "Hyprland" ]; then
yay -S --needed hyprland \
waybar waybar-updates \
hyprlock \
swww \
hyprswitch \
nwg-dock-hyprland \
nwg-drawer \
swaync \
wayland-logout \
hyprpicker \
pulseaudio-control \
wl-clipboard \
grim \
slurp \
hyprsunset \
darkman \
anyrun-git
fi

View file

@ -0,0 +1,3 @@
#!/bin/env sh
yadm decrypt

View file

@ -0,0 +1,5 @@
#!/bin/env bash
yay -S --needed getnf
getnf -i "JetBrainsMono"
fc-cache

View file

@ -0,0 +1,4 @@
#!/bin/env sh
echo "# Installing GTK Theme (gruvbox)"
yay -S --needed gruvbox-material-icon-theme-git gruvbox-gtk-theme-git

View file

@ -0,0 +1,10 @@
#!/bin/env bash
echo "# Installing keymapping"
yay -S --needed evremap
sudo gpasswd -a $USER input
echo 'KERNEL=="uinput", GROUP="input"' | sudo tee /etc/udev/rules.d/input.rules
mkdir -p $HOME/.log

View file

@ -0,0 +1,5 @@
#!/bin/env sh
yay -S --needed python-pywal
wal --theme base16-gruvbox-medium

View file

@ -0,0 +1,5 @@
#!/bin/env sh
sudo pacman -S --needed sass
sh -c "$HOME/.config/theming/compile.sh"

View file

@ -0,0 +1,6 @@
#!/bin/env sh
yay -S --needed zen-browser-bin \
zathura zathura-pdf-mupdf \
onlyoffice-bin \
bitwarden

View file

@ -0,0 +1,9 @@
#!/bin/env sh
yay -S --needed gnome-keyring \
git-credential-oauth
git credential-oauth configure
git config --global user.email "git@iedsoftworks.com"
git config --global user.name "Michel Fedde"

View file

@ -0,0 +1,11 @@
#!/bin/env sh
PREV_DIRECTORY=$PWD
git clone https://github.com/kjlo/hyprdrop ~/.cache/hyprdrop
cd ~/.cache/hyprdrop
cargo install --path .
cd $PREV_DIRECTORY
rm -rf ~/.cache/hyprdrop

View file

@ -0,0 +1,7 @@
#!/bin/env sh
yay -S --needed kdeconnect
sudo firewall-cmd --permanent --add-port=1714-1764/{tcp,udp}
echo "-- For some reason, its recommended to reboot your device to make kdeconnect work..."

View file

@ -0,0 +1,14 @@
#!/bin/env sh
echo "# Installing thunar"
yay -S --needed thunar \
gvfs \
thunar-archive-plugin \
thunar-media-tags-plugin \
thunar-shares-plugin \
thunar-volman \
tumbler \
libgsf \
raw-thumbnailer \
tumbler-extra-thumbnailers

View file

@ -0,0 +1,5 @@
#!/bin/env sh
yay -S --needed vimiv
xdg-mime default vimiv.default image/{png,jpeg}

View file

@ -0,0 +1,6 @@
#!/bin/env sh
yay -S --needed yazi p7zip jq poppler fd ripgrep fzf zoxide imagemagick fuse-archive zip \
blobdrop-git
ya pack --install

View file

@ -0,0 +1,7 @@
#!/bin/env sh
yay -S --needed zsh oh-my-zsh
chsh -s $(which zsh)
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --keep-zshrc --unattended || exit 0

View file

@ -0,0 +1,21 @@
#!/bin/env sh
declare -A repositories
repositories['DSA']="ssh://git.php.fail/neintonine/dsa.git"
repositories['Notes']="ssh://git.php.fail/neintonine/notes.git"
repositories['gameconcepts']="ssh://git.php.fail/neintonine/game-concepts.git"
for path in "${!repositories[@]}"; do
url=${repositories[$path]}
realPath="${HOME}/$path"
if [ -d "$realPath" ]; then
echo "-- $realPath already exist... skipping clone"
continue
fi
echo "-- Cloning to $realPath";
git clone "$url" "$realPath"
done