refractor(bootstrap): Format with shfmt

This commit is contained in:
js0ny 2025-02-24 00:42:55 +00:00
parent f015467b1b
commit 0ce74497cd
21 changed files with 271 additions and 377 deletions

View file

@ -1,3 +1,5 @@
#!/usr/bin/env bash
# vim:ft=bash
echo "[INFO] Installing AppMan"
echo "[ACTION] Type [2] to install AppMan"
wget -q https://raw.githubusercontent.com/ivan-hc/AM/main/AM-INSTALLER && chmod a+x ./AM-INSTALLER && ./AM-INSTALLER
@ -5,6 +7,6 @@ wget -q https://raw.githubusercontent.com/ivan-hc/AM/main/AM-INSTALLER && chmod
APPMAN_PATH="$HOME/.local/bin/appman"
if command -v $APPMAN_PATH >/dev/null 2>&1; then
$APPMAN_PATH install wezterm
$APPMAN_PATH install nvim
$APPMAN_PATH install wezterm
$APPMAN_PATH install nvim
fi

View file

@ -1,4 +1,5 @@
#!/bin/bash
#!/usr/bin/env bash
# vim:ft=bash
# chromium-flags.sh
# Set Chromium & Electron Flags
@ -12,35 +13,34 @@ ELECTRON_FLAG=$DOTFILES/platforms/linux/electron-flags.conf
# Browser Flags
browser_flags_path=(
"$XDG_CONFIG_HOME/chromium-flags.conf" # Chromium
"$XDG_CONFIG_HOME/chrome-flags.conf" # Google Chrome
"$XDG_CONFIG_HOME/thorium-flags.conf" # Thorium
"$XDG_CONFIG_HOME/vivaldi-flags.conf" # Vivaldi
"$XDG_CONFIG_HOME/vivaldi-stable.conf" # Vivaldi
"$XDG_CONFIG_HOME/chromium-flags.conf" # Chromium
"$XDG_CONFIG_HOME/chrome-flags.conf" # Google Chrome
"$XDG_CONFIG_HOME/thorium-flags.conf" # Thorium
"$XDG_CONFIG_HOME/vivaldi-flags.conf" # Vivaldi
"$XDG_CONFIG_HOME/vivaldi-stable.conf" # Vivaldi
)
electron_flags_path=(
"$XDG_CONFIG_HOME/electron-flags.conf" # General
"$XDG_CONFIG_HOME/code-flags.conf" # VSCode
"$XDG_CONFIG_HOME/qq-electron-flags.conf" # Slack
"$XDG_CONFIG_HOME/electron-flags.conf" # General
"$XDG_CONFIG_HOME/code-flags.conf" # VSCode
"$XDG_CONFIG_HOME/qq-electron-flags.conf" # Slack
)
for path in "${browser_flags_path[@]}"; do
if [ -f "$path" ]; then
echo "[INFO] Found Browser Flags: $path"
else
echo "[INFO] Creating Browser Flags: $path"
ln -s $BROWSER_FLAG $path
fi
if [ -f "$path" ]; then
echo "[INFO] Found Browser Flags: $path"
else
echo "[INFO] Creating Browser Flags: $path"
ln -s $BROWSER_FLAG $path
fi
done
for path in "${electron_flags_path[@]}"; do
if [ -f "$path" ]; then
echo "[INFO] Found Electron Flags: $path"
else
echo "[INFO] Creating Electron Flags: $path"
ln -s $ELECTRON_FLAG $path
fi
if [ -f "$path" ]; then
echo "[INFO] Found Electron Flags: $path"
else
echo "[INFO] Creating Electron Flags: $path"
ln -s $ELECTRON_FLAG $path
fi
done

View file

@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# vim:ft=bash
set -e
@ -21,15 +21,15 @@ fi
export WHEEL
GUI_SETUP=0
if [ "$(uname -r)" = *Microsoft* ]; then
# NOTE: This is NOT a POSIX-compliant way, for POSIX-compliant way, use case/esac
if [[ "$(uname -r)" = *Microsoft* ]]; then
echo "[INFO] Running on WSL1 Skipping GUI setup"
else
read -p "[ACTION] Do you want to setup Linux GUI? (y/N) " choice
case "$choice" in
y|Y)
y | Y)
GUI_SETUP=1
;;
*)
@ -70,8 +70,8 @@ fi
if [ "$WHEEL" -eq 0 ]; then
read -p "[ACTION] Do you want to install some AppImages (by AppMan)? (y/N) " choice
case "$choice" in
y|Y)
source "$DOTFILES/bootstrap/linux/appman.bash"
y | Y)
source "$DOTFILES/bootstrap/linux/appman.bash"
;;
*)
echo "[INFO] Skipping AppMan installation"
@ -96,7 +96,7 @@ if command -v zsh >/dev/null 2>&1; then
read -p "[ACTION] Do you want to setup zsh? (Y/n) " choice
case "$choice" in
n|N)
n | N)
:
;;
*)
@ -105,7 +105,6 @@ if command -v zsh >/dev/null 2>&1; then
esac
fi
if [ "$WHEEL" -eq 0 ]; then
echo "Done!"
exit 0
@ -113,7 +112,7 @@ fi
read -p "[ACTION] Do you want to use other package managers? (y/N) " choice
case "$choice" in
y|Y)
y | Y)
:
;;
*)
@ -143,5 +142,4 @@ echo "[INFO] Installing Color Scheme (Catppuccin Mocha)"
fish $DOTFILES/bootstrap/temp/mocha_port.fish
echo "Done!"

View file

@ -1,9 +1,10 @@
#!/usr/bin/env bash
# vim:ft=bash
set -e # Exit immediately if a command exits with a non-zero status
declare -A linkDots
source "$DOTFILES/bootstrap/components/symlinks.sh"
source "$DOTFILES/bootstrap/components/symlinks.bash"
echo "[INFO] DOTFILES = $DOTFILES"
@ -13,16 +14,16 @@ read -n 1
echo "[INFO] Setting up symbolic links"
for src in "${!linkDots[@]}"; do
dest="${linkDots[$src]}"
echo "Linking $src to $dest"
if [ -d "$src" ]; then
test -d "$dest" && mv "$dest" "$dest.bak"
ln -sf "$src" "$dest"
elif [ -f "$src" ]; then
dest_parent=$(dirname "$dest")
test -d "$dest_parent" || mkdir -p "$dest_parent"
ln -sf "$src" "$dest"
else
echo "[ERROR] $src does not exist"
fi
dest="${linkDots[$src]}"
echo "Linking $src to $dest"
if [ -d "$src" ]; then
test -d "$dest" && mv "$dest" "$dest.bak"
ln -sf "$src" "$dest"
elif [ -f "$src" ]; then
dest_parent=$(dirname "$dest")
test -d "$dest_parent" || mkdir -p "$dest_parent"
ln -sf "$src" "$dest"
else
echo "[ERROR] $src does not exist"
fi
done