refactor
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Central theme: catppuccin-mocha (Catppuccin Mocha), hyprland $vars.
|
||||
# Part of basic/.config/themes. Managed file: refresh via
|
||||
# basic/scripts/fetch-ports.sh
|
||||
# setup/fetch-ports.sh
|
||||
# (upstream: catppuccin/hyprland generated mocha.conf).
|
||||
# Hyprland consumers load it via: source = ~/.config/themes/current/hypr.conf
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Central theme: catppuccin-mocha (Catppuccin Mocha), kitty colors.
|
||||
# Part of basic/.config/themes. Managed file: refresh via
|
||||
# basic/scripts/fetch-ports.sh
|
||||
# setup/fetch-ports.sh
|
||||
# (upstream: catppuccin/kitty themes/mocha.conf).
|
||||
# vim:ft=kitty
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
setup.sh
|
||||
packages.txt
|
||||
scripts
|
||||
.stow-ignore
|
||||
@@ -1,25 +0,0 @@
|
||||
# ---------------------------------------------------------------------------
|
||||
# System package list for basic/setup.sh
|
||||
#
|
||||
# Every other dotfile branch depends on these foundational packages
|
||||
# (base system, display manager, audio stack, AUR helper).
|
||||
# `basic` is always set up first in the Makefile.
|
||||
#
|
||||
# - Lines starting with '#' and blank lines are ignored.
|
||||
# - Use "@pacman", "@aur" or "@npm" markers to switch section.
|
||||
# - The default section is @pacman.
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
@pacman
|
||||
firefox
|
||||
cups
|
||||
pipewire
|
||||
pipewire-session-manager
|
||||
qpwgraph
|
||||
cifs-utils
|
||||
less
|
||||
git
|
||||
ripgrep
|
||||
fd
|
||||
docker
|
||||
man-db
|
||||
@@ -1,26 +0,0 @@
|
||||
#!/bin/bash
|
||||
# Refresh vendored upstream port files (basic/scripts/fetch-ports.sh).
|
||||
#
|
||||
# This script is intentionally NOT stowed (basic/.stow-ignore) and NOT run
|
||||
# by the test harness: it contacts the network. Run it manually when you
|
||||
# want to pull newer upstream Catppuccin ports into the central theme:
|
||||
#
|
||||
# bash basic/scripts/fetch-ports.sh
|
||||
#
|
||||
# The central palette (theme.lua / theme.css roles / hypr.conf) remains the
|
||||
# source of truth; after fetching, re-apply the provenance headers and the
|
||||
# role-alias block at the end of theme.css if upstream overwrote them.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
DEST="$SCRIPT_DIR/../.config/themes/themes/catppuccin-mocha"
|
||||
|
||||
# Pinned upstream revisions (bump deliberately, then run this script).
|
||||
KITTY_PIN="main"
|
||||
|
||||
curl -fsSL "https://raw.githubusercontent.com/catppuccin/kitty/${KITTY_PIN}/themes/mocha.conf" \
|
||||
-o "$DEST/kitty.conf"
|
||||
|
||||
echo "ports refreshed into $DEST"
|
||||
echo "reminder: re-apply file headers + theme.css role aliases, then run scripts/sync-theme.sh"
|
||||
-150
@@ -1,150 +0,0 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PACKAGES_FILE="$SCRIPT_DIR/packages.txt"
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Enable multilib in /etc/pacman.conf (with a safety backup)
|
||||
# ---------------------------------------------------------------------------
|
||||
enable_multilib() {
|
||||
sudo sed -i.bak '/^#\[multilib\]/,+1 s/^#//' /etc/pacman.conf
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Ensure yay (AUR helper) is installed.
|
||||
# ---------------------------------------------------------------------------
|
||||
install_yay() {
|
||||
if pacman -Q yay &>/dev/null; then
|
||||
echo "yay bereits installiert; fahre fort."
|
||||
return
|
||||
fi
|
||||
if pacman -Si yay &>/dev/null; then
|
||||
echo "Installiere yay mit pacman ..."
|
||||
sudo pacman -S --needed yay
|
||||
return
|
||||
fi
|
||||
echo "installiere yay via git ..."
|
||||
sudo pacman -S --needed base-devel git
|
||||
local tmp
|
||||
tmp="$(mktemp -d)"
|
||||
git clone https://aur.archlinux.org/yay.git "$tmp/yay"
|
||||
(
|
||||
cd "$tmp/yay"
|
||||
makepkg -si
|
||||
)
|
||||
rm -rf "$tmp"
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Read packages.txt, split into pacman / aur / npm sections.
|
||||
# ---------------------------------------------------------------------------
|
||||
read_packages() {
|
||||
local section="pacman"
|
||||
local current
|
||||
current=""
|
||||
while IFS= read -r line || [[ -n "$line" ]]; do
|
||||
current="${line%%#*}"
|
||||
current="${current##*( )}"
|
||||
current="${current%%*( )}"
|
||||
[[ -z "$current" ]] && continue
|
||||
case "$current" in
|
||||
@pacman) section="pacman" ;;
|
||||
@aur) section="aur" ;;
|
||||
@npm) section="npm" ;;
|
||||
*)
|
||||
case "$section" in
|
||||
pacman) pacman_pkgs+=("$current") ;;
|
||||
aur) aur_pkgs+=("$current") ;;
|
||||
npm) npm_pkgs+=("$current") ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
done < "$PACKAGES_FILE"
|
||||
}
|
||||
|
||||
declare -a pacman_pkgs=() aur_pkgs=() npm_pkgs=()
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Install sections.
|
||||
# ---------------------------------------------------------------------------
|
||||
install_pacman() {
|
||||
if ((${#pacman_pkgs[@]})); then
|
||||
echo "==> Installiere Pacman-Pakete: ${pacman_pkgs[*]}"
|
||||
yay -S --needed "${pacman_pkgs[@]}"
|
||||
fi
|
||||
}
|
||||
|
||||
install_aur() {
|
||||
if ((${#aur_pkgs[@]})); then
|
||||
echo "==> Installiere AUR-Pakete: ${aur_pkgs[*]}"
|
||||
yay -S --needed "${aur_pkgs[@]}"
|
||||
fi
|
||||
}
|
||||
|
||||
install_npm() {
|
||||
if ((${#npm_pkgs[@]})); then
|
||||
echo "==> Installiere globale npm-Pakete: ${npm_pkgs[*]}"
|
||||
npm install -g "${npm_pkgs[@]}"
|
||||
fi
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Docker: Dienst aktivieren/starten, Benutzer in die docker-Gruppe aufnehmen
|
||||
# und den Dienst verifizieren. (docker selbst wird ueber basic/packages.txt
|
||||
# als Pacman-Paket installiert.)
|
||||
# ---------------------------------------------------------------------------
|
||||
setup_docker() {
|
||||
if ! command -v docker >/dev/null 2>&1; then
|
||||
echo "Warnung: docker nicht installiert; ueberspringe Docker-Setup."
|
||||
return
|
||||
fi
|
||||
|
||||
echo "==> Aktiviere und starte Docker-Dienst ..."
|
||||
sudo systemctl enable --now docker
|
||||
|
||||
# Bei Aufruf via `sudo <script>` ist SUDO_USER der eigentliche Benutzer.
|
||||
local target_user="${SUDO_USER:-$USER}"
|
||||
echo "==> Stelle sicher, dass $target_user in der docker-Gruppe ist ..."
|
||||
if [[ "$target_user" == "root" ]] || id -nG "$target_user" 2>/dev/null | grep -qw docker; then
|
||||
echo "Benutzer $target_user ist bereits in der docker-Gruppe."
|
||||
else
|
||||
sudo usermod -aG docker "$target_user"
|
||||
echo "Benutzer $target_user zur docker-Gruppe hinzugefuegt; wirksam nach dem naechsten Login."
|
||||
fi
|
||||
|
||||
echo "==> Pruefe Docker-Dienst ..."
|
||||
if systemctl is-active --quiet docker; then
|
||||
echo "Docker-Dienst laeuft (Socket: /var/run/docker.sock)."
|
||||
else
|
||||
echo "Warnung: Docker-Dienst laeuft nicht; pruefe mit: systemctl status docker"
|
||||
fi
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Main
|
||||
# ---------------------------------------------------------------------------
|
||||
main() {
|
||||
echo "==> Aktiviere multilib ..."
|
||||
enable_multilib
|
||||
|
||||
echo "==> System aktualisieren ..."
|
||||
sudo pacman -Syu
|
||||
|
||||
echo "==> Sicherstelle yay ..."
|
||||
install_yay
|
||||
|
||||
echo "==> Lese Paketliste: $PACKAGES_FILE"
|
||||
read_packages
|
||||
|
||||
install_pacman
|
||||
install_aur
|
||||
install_npm
|
||||
|
||||
echo "==> Richte Docker ein ..."
|
||||
setup_docker
|
||||
|
||||
echo "Fertig. Die Basis-Systemumgebung ist eingerichtet."
|
||||
}
|
||||
|
||||
main
|
||||
Reference in New Issue
Block a user