Completes bootstrap.v2 setup

This commit is contained in:
Michel Fedde 2025-04-21 23:00:19 +02:00
parent 2bbccb4595
commit b8192c832e
24 changed files with 86 additions and 143 deletions

3
.config/yadm/bootstrap Executable file
View file

@ -0,0 +1,3 @@
#!/bin/env sh
$HOME/.config/yadm/bootstrap.v2/bootstrap

View file

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

@ -1,3 +0,0 @@
#!/bin/env sh
xdg-mime default vimiv.desktop image/{png,jpeg}

View file

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

View file

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

@ -1,21 +0,0 @@
#!/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

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

View file

@ -3,4 +3,8 @@
addApplications bluez \
bluez-utils
sudo systemctl enable --now bluetooth.service
setupBluetooth() {
sudo systemctl enable --now bluetooth.service
}
addActions setupBluetooth

View file

@ -4,8 +4,6 @@ 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 \

View file

@ -3,4 +3,6 @@
addApplications zen-browser-bin \
zathura zathura-pdf-mupdf \
onlyoffice-bin \
bitwarden
bitwarden \
blueman \
planify

View file

@ -3,16 +3,4 @@
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
addActions "git credential-oauth configure"

View file

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

View file

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

View file

@ -1,3 +1,11 @@
#!/bin/env sh
addApplications kdeconnect
setupKDEConnect() {
sudo firewall-cmd --permanent --add-port=1714-1764/{tcp,udp}
echo "-- For some reason, its recommended to reboot your device to make kdeconnect work..."
}
addActions setupKDEConnect

View file

@ -1,7 +1,5 @@
#!/bin/env sh
echo "# Installing thunar"
addApplications thunar \
gvfs \
thunar-archive-plugin \

0
.config/yadm/bootstrap.v2/applications/30-Vimiv.sh Normal file → Executable file
View file

View file

@ -1,3 +1,13 @@
#!/bin/env sh
addApplications zsh oh-my-zsh
setupZsh() {
chsh -s $(which zsh)
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --keep-zshrc --unattended || return 0
}
if [ $SHELL != "/usr/bin/zsh" ]; then
addActions setupZsh
fi

View file

@ -0,0 +1,25 @@
#!/bin/env sh
setupGitRepositories() {
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
}
addActions setupGitRepositories

View file

@ -0,0 +1,6 @@
#!/bin/env sh
setupMimeTypes() {
xdg-mime default vimiv.desktop image/{png,jpeg}
}
addActions setupMimeTypes

View file

@ -0,0 +1,9 @@
#!/bin/env sh
reloadDarkman() {
echo "# Refreshing darkman (bruteforce method)"
darkman toggle
darkman toggle
}
addActions reloadDarkman

View file

@ -7,11 +7,9 @@ SCRIPTPATH="$(
pwd -P
)"
APPLICATIONS_PATH="$SCRIPTPATH/applications"
ACTIONS_PATH="$SCRIPTPATH/actions"
#$SCRIPTPATH/functions/set_class.sh
$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
@ -30,7 +28,7 @@ actions=()
addApplications ()
{
for application in "$@"; do
echo "adding application: $application"
# echo "adding application: $application"
applications+=("$application")
done
@ -39,7 +37,7 @@ addApplications ()
addActions()
{
for action in "$@"; do
echo "adding action: $action"
# echo "adding action: $action"
actions+=("$action")
done
@ -55,4 +53,8 @@ echo -n "# Installing/Updating applications (${#applications[@]})"
installPackages ${applications[*]}
echo "# Executing actions... (${#actions[@]})"
for action in "${actions[@]}";
do
echo "==> Now executing: ${action}"
$action
done

View file

@ -1,74 +0,0 @@
#!/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
}