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,5 @@
#!/bin/env sh
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,3 @@
#!/bin/env sh
xdg-mime default vimiv.desktop image/{png,jpeg}

View file

@ -0,0 +1,3 @@
#!/bin/env sh
ya pack --install

View file

@ -0,0 +1,5 @@
#!/bin/env sh
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

View file

@ -0,0 +1,5 @@
#!/bin/env sh
echo "# Refreshing darkman (bruteforce method)"
darkman toggle
darkman toggle

View file

@ -0,0 +1,9 @@
#!/bin/env bash
addApplications neovim \
network-manager-applet \
ghostty \
btop \
zoxide fzf \
wifi-qr neovim \
brightnessctl

View file

@ -0,0 +1,5 @@
#!/bin/env sh
addApplications mesa lib32-mesa \
xf86-video-amdgpu \
vulkan-radeon lib32-vulkan-radeon

View file

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

View file

@ -0,0 +1,28 @@
#!/bin/env sh
SDDM_THEME_PATH="/etc/sddm.conf.d/theme.conf"
addApplications sddm catppuccin-sddm-theme-mocha
sddm() {
sudo mkdir -p /etc/sddm.conf.d
sudo ln ~/.config/sddm/theme.conf /etc/sddm.conf.d/theme.conf
sudo systemctl enable sddm
}
check() {
if ! command -v sddm >/dev/null; then
return 0
fi
if [ ! -f "$SDDM_THEME_PATH" ]; then
return 0
fi
return 1
}
if check; then
addAction sddm
fi

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 "-- Adding dependencies for $XDG_SESSION_DESKTOP"
if [ $XDG_SESSION_DESKTOP = "i3" ]; then
addApplications polybar \
betterlockscreen \
dunst \
pulseaudio-control \
nitrogen
fi
if [ $XDG_SESSION_DESKTOP = "Hyprland" ]; then
addApplications 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
addActions "yadm decrypt"

View file

@ -0,0 +1,14 @@
#!/bin/env bash
addApplications getnf
REQUESTED_FONT="JetBrainsMono"
fonts() {
getnf -i "JetBrainsMono"
fc-cache
}
if ! getnf -l | grep "$REQUESTED_FONT" >/dev/null; then
addActions fonts
fi

View file

@ -0,0 +1,3 @@
#!/bin/env sh
addApplications gruvbox-material-icon-theme-git gruvbox-gtk-theme-git

View file

@ -0,0 +1,31 @@
#!/bin/env bash
addApplications evremap
keymap() {
sudo gpasswd -a $USER input
echo 'KERNEL=="uinput", GROUP="input"' | sudo tee /etc/udev/rules.d/input.rules
mkdir -p $HOME/.log
}
check() {
if ! id | grep input >>/dev/null; then
return 0
fi
if [ ! -f "/etc/udev/rules.d/input.rules" ]; then
return 0
fi
if [ ! -d "$HOME/.log" ]; then
return 0
fi
return 1
}
if check; then
addActions keymap
fi

View file

@ -0,0 +1,3 @@
#!/bin/env sh
addApplications python-pywal sass

View file

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

View file

@ -0,0 +1,18 @@
#!/bin/env sh
addApplications git gnome-keyring \
git-credential-oauth
configure-git-oauth() {
git credential-oauth configure
}
#source ./30-GitUserConfig.sh.add
if ! git config list | grep "credential.helper=oauth" >/dev/null; then
addActions configure-git-oauth
fi
if ! git config list | grep "user.name" > /dev/null; then
addActions git-user-config
fi

View file

@ -0,0 +1,6 @@
#!/bin/env sh
git-user-config() {
git config --global user.email "fedde@eventit.ag"
git config --global user.name "Michel Fedde"
}

View file

@ -0,0 +1,6 @@
#!/bin/env sh
git-user-config() {
git config --global user.email "git@iedsoftworks.com"
git config --global user.name "Michel Fedde"
}

View file

@ -0,0 +1,37 @@
#!/bin/env sh
HYPRDROP_GIT_PATH="$HOME/.cache/hyprdrop"
install_hyprdrop() {
PREV_DIRECTORY=$PWD
if [ ! -d "$HYPRDROP_GIT_PATH" ]; then
git clone https://github.com/kjlo/hyprdrop "$HYPRDROP_GIT_PATH"
fi
cd ~/.cache/hyprdrop
cargo install --path .
cd $PREV_DIRECTORY
}
check_hyprdrop() {
if [ ! -d "$HOME/.cache/hyprdrop" ]; then
return 0
fi
PREV_DIRECTORY=$PWD
cd $HYPRDROP_GIT_PATH
if ! git remote update && git status | grep behind >>/dev/null; then
cd $PREV_DIRECTORY
return 0
fi
return 1
}
if check_hyprdrop; then
addActions install_hyprdrop
fi

View file

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

View file

@ -0,0 +1,14 @@
#!/bin/env sh
echo "# Installing thunar"
addApplications 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,3 @@
#!/bin/env sh
addApplications vimiv

View file

@ -0,0 +1,4 @@
#!/bin/env sh
addApplications yazi p7zip jq poppler fd ripgrep fzf zoxide imagemagick fuse-archive zip \
blobdrop-git

View file

@ -0,0 +1,3 @@
#!/bin/env sh
addApplications zsh oh-my-zsh

View file

@ -0,0 +1,58 @@
#!/bin/env sh
set -eu
SCRIPTPATH="$(
cd -- "$(dirname "$0")" >/dev/null 2>&1
pwd -P
)"
APPLICATIONS_PATH="$SCRIPTPATH/applications"
ACTIONS_PATH="$SCRIPTPATH/actions"
#$SCRIPTPATH/functions/set_class.sh
source $SCRIPTPATH/functions/pkg.sh
source $SCRIPTPATH/functions/filerunner.sh
if [[ ! -d "$APPLICATIONS_PATH" ]]; then
echo "Error: applications directory '$APPLICATIONS_PATH' not found" >&2
exit 1
fi
echo -n "# Updating system"
updateSystem
echo "# Gathering applications"
declare -x -a applications
declare -x -a actions
actions=()
addApplications ()
{
for application in "$@"; do
echo "adding application: $application"
applications+=("$application")
done
}
addActions()
{
for action in "$@"; do
echo "adding action: $action"
actions+=("$action")
done
}
while IFS= read -r file; do
if [[ -x "$file" && ! "$file" =~ "##" && ! "$file" =~ ~$ && ! "$file" =~ ".bak" ]]; then
source $file
fi
done < <(find -L "$APPLICATIONS_PATH" -type f | sort)
echo -n "# Installing/Updating applications (${#applications[@]})"
installPackages ${applications[*]}
echo "# Executing actions... (${#actions[@]})"

View file

@ -0,0 +1,74 @@
#!/bin/env sh
_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 commandName=$(basename $command)
local prompt="Do you wish to run $commandName? [Ynq]"
local display="Executing $commandName"
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
}

View file

@ -0,0 +1,29 @@
#!/bin/env sh
installPackages() {
packages=$@
if command -v yay >/dev/null; then
echo " using yay"
yay -S --needed $packages
elif command -v apt >/dev/null; then
echo " using apt"
apt install $packages
else
echo "... no supported package manager found. exiting"
exit 1
fi
}
updateSystem() {
if command -v yay >/dev/null; then
echo " using yay"
yay
elif command -v apt >/dev/null; then
echo " using apt"
apt update
else
echo "... no supported package manager found. exiting"
exit 1
fi
}

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