update to lua
This commit is contained in:
+104
-28
@@ -1,36 +1,112 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
|
||||
WALLPAPER_DIR=$(scripts/install/wallpaper_dir.sh)
|
||||
|
||||
copy_missing() {
|
||||
local dest="$1"
|
||||
local filename
|
||||
filename="$(basename "$dest")"
|
||||
local src="$SCRIPT_DIR/examples/$filename.example"
|
||||
# ----------------------------
|
||||
# UI helpers
|
||||
# ----------------------------
|
||||
info() { echo -e "\033[1;34m[INFO]\033[0m $*"; }
|
||||
ok() { echo -e "\033[1;32m[ OK ]\033[0m $*"; }
|
||||
warn() { echo -e "\033[1;33m[WARN]\033[0m $*"; }
|
||||
fail() { echo -e "\033[1;31m[FAIL]\033[0m $*"; }
|
||||
|
||||
if [ -e "$dest" ]; then
|
||||
echo "Already exists: $dest"
|
||||
else
|
||||
echo "Creating: $dest"
|
||||
cp "$src" "$dest"
|
||||
fi
|
||||
# ----------------------------
|
||||
# Packages
|
||||
# ----------------------------
|
||||
REQUIRED_PKGS=(
|
||||
hyprland-qt-support
|
||||
hyprcursor
|
||||
hypridle
|
||||
hyprlock
|
||||
libnotify
|
||||
jq
|
||||
inetutils
|
||||
)
|
||||
|
||||
OPTIONAL_PKGS=(
|
||||
hyprpaper "Wallpaper daemon" OFF
|
||||
carla "Audio plugin host" OFF
|
||||
gnome-keyring "Secrets management" OFF
|
||||
curl "HTTP requests" OFF
|
||||
wofi "Launcher" OFF
|
||||
kitty "Terminal" OFF
|
||||
nautilus "File manager" OFF
|
||||
wtype "Typing tool" OFF
|
||||
ydotool "Input automation" OFF
|
||||
imagemagick "Image tools" OFF
|
||||
playerctl "Media control" OFF
|
||||
wlopm "Monitor power" OFF
|
||||
hyprshot "Screenshot tool" OFF
|
||||
matugen "Theme generator" OFF
|
||||
)
|
||||
|
||||
# ----------------------------
|
||||
# Optional selection (ONLY whiptail use)
|
||||
# ----------------------------
|
||||
command -v whiptail &>/dev/null || {
|
||||
fail "whiptail is required for selection"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [ ! -d "$SCRIPT_DIR/user_config" ]; then
|
||||
mkdir "$SCRIPT_DIR/user_config"
|
||||
echo "$SCRIPT_DIR/user_config created"
|
||||
info "Selecting optional packages..."
|
||||
SELECTED=$(whiptail --title "Optional Packages" --checklist \
|
||||
"Select extras to install:" 18 70 10 \
|
||||
"${OPTIONAL_PKGS[@]}" \
|
||||
3>&1 1>&2 2>&3) || {
|
||||
fail "Cancelled"
|
||||
exit 1
|
||||
}
|
||||
|
||||
OPT_ARGS=()
|
||||
[[ -n "${SELECTED:-}" ]] && eval "OPT_ARGS=($SELECTED)"
|
||||
|
||||
ok "Selection complete"
|
||||
|
||||
# ----------------------------
|
||||
# Config setup
|
||||
# ----------------------------
|
||||
info "Preparing config files..."
|
||||
|
||||
mkdir -p "$SCRIPT_DIR/scripts/autostart"
|
||||
|
||||
[[ ! -f "$SCRIPT_DIR/scripts/autostart/workspace" ]] && {
|
||||
cp "$SCRIPT_DIR/examples/workspace.example" "$SCRIPT_DIR/scripts/autostart/workspace"
|
||||
ok "workspace config created"
|
||||
}
|
||||
|
||||
[[ ! -f "$SCRIPT_DIR/hyprlock.conf" ]] && {
|
||||
cp "$SCRIPT_DIR/examples/hyprlock.conf.example" "$SCRIPT_DIR/hyprlock.conf"
|
||||
ok "hyprlock config created"
|
||||
}
|
||||
|
||||
[[ ! -f "$SCRIPT_DIR/hyprpaper.conf" ]] && {
|
||||
cp "$SCRIPT_DIR/examples/hyprpaper.conf.example" "$SCRIPT_DIR/hyprpaper.conf"
|
||||
ok "hyprpaper config created"
|
||||
}
|
||||
|
||||
# ----------------------------
|
||||
# Install
|
||||
# ----------------------------
|
||||
info "Updating system..."
|
||||
sudo pacman -Syu --noconfirm
|
||||
ok "System updated"
|
||||
|
||||
info "Installing required packages..."
|
||||
sudo pacman -S --needed --noconfirm "${REQUIRED_PKGS[@]}"
|
||||
ok "Required packages installed"
|
||||
|
||||
if [[ ${#OPT_ARGS[@]} -gt 0 ]]; then
|
||||
info "Installing optional packages..."
|
||||
sudo pacman -S --needed --noconfirm "${OPT_ARGS[@]}"
|
||||
ok "Optional packages installed"
|
||||
else
|
||||
echo "$SCRIPT_DIR/user_config exists"
|
||||
warn "No optional packages selected"
|
||||
fi
|
||||
|
||||
copy_missing "$SCRIPT_DIR/user_config/monitor.conf"
|
||||
copy_missing "$SCRIPT_DIR/user_config/input.conf"
|
||||
copy_missing "$SCRIPT_DIR/user_config/workspace.conf"
|
||||
copy_missing "$SCRIPT_DIR/scripts/autostart/workspace"
|
||||
copy_missing "$SCRIPT_DIR/user_config/bind.conf"
|
||||
copy_missing "$SCRIPT_DIR/user_config/input.conf"
|
||||
copy_missing "$SCRIPT_DIR/hyprlock.conf"
|
||||
copy_missing "$SCRIPT_DIR/hyprpaper.conf"
|
||||
copy_missing "$SCRIPT_DIR/config/autostart.conf"
|
||||
|
||||
echo "The script will now install dependencies via pacman"
|
||||
sudo pacman -S --needed hyprland-qt-support hyprcursor hypridle hyprlock hypridle
|
||||
# ----------------------------
|
||||
# Done
|
||||
# ----------------------------
|
||||
echo
|
||||
ok "Setup complete"
|
||||
info "Restart Hyprland to apply changes"
|
||||
Reference in New Issue
Block a user