basic and utils: overhaul set-up
This commit is contained in:
@@ -1,23 +1,33 @@
|
||||
# setup ist ein Kommando-Target (keine Datei) und soll immer ausgeführt werden.
|
||||
.PHONY: basic
|
||||
# Alle Targets sind Kommando-Targets (keine Dateien) und werden immer ausgeführt.
|
||||
.PHONY: basic term utils hypr kreation buntes-monster
|
||||
|
||||
term:
|
||||
# basic wird immer zuerst eingerichtet: es legt die Basis-Systemumgebung an
|
||||
# (multilib, yay, Display-Manager, Audio-Stack), von der alle anderen
|
||||
# Zweige abhaengen. Die uebrigen Ziele haengen nur von basic ab und sind
|
||||
# untereinander unabhaengig.
|
||||
basic:
|
||||
bash basic/setup.sh
|
||||
|
||||
term: basic
|
||||
bash term/setup.sh
|
||||
stow term
|
||||
basic: term
|
||||
bash _install_skripte_install_basic_pcks.sh
|
||||
stow nvim
|
||||
|
||||
utils: basic
|
||||
bash utils/setup.sh
|
||||
bash _install_skripte/nextcloud.sh
|
||||
|
||||
hypr: basic
|
||||
bash _install_skripte_install_hypr_pcks.sh
|
||||
bash _install_skripte/install_hypr_pcks.sh
|
||||
stow hypr
|
||||
bash hypr/.config/hypr/scripts/ensure-env.sh
|
||||
bash hypr/.config/hypr/scripts/portal-host-override.sh
|
||||
bash hypr/.config/hypr/scripts/fix_dolphin_file_associations.sh
|
||||
|
||||
kreation: basic
|
||||
bash _install_skripte_install_kreation_pcks.sh
|
||||
bash _install_skripte/install_kreation_pcks.sh
|
||||
stow kreation
|
||||
bunters-monster: basic hypr kreation
|
||||
|
||||
buntes-monster: hypr kreation
|
||||
_install_skripte/buntes-monster-links.sh
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
sudo pacman -S --needed \
|
||||
firefox \
|
||||
nextcloud-client \
|
||||
cups \
|
||||
wine \
|
||||
wine-mono \
|
||||
wine-gecko \
|
||||
winetricks \
|
||||
thunderbird \
|
||||
ktouch \
|
||||
ktorrent \
|
||||
pipewire \
|
||||
pipewire-session-manager \
|
||||
qpwgraph \
|
||||
cifs-utils \
|
||||
rbw \
|
||||
sddm
|
||||
|
||||
yay -S \
|
||||
catppuccin-sddm-theme-mocha
|
||||
|
||||
echo "
|
||||
[General]
|
||||
Numlock=on
|
||||
|
||||
[Theme]
|
||||
ThemeDir=/usr/share/sddm/themes # Standardverzeichnis für Designvorlagen
|
||||
Current=catppuccin-mocha-blue # Standardthema
|
||||
CursorTheme=breeze_cursors # Mausthema
|
||||
FacesDir=/usr/share/sddm/faces # Verzeichnis für Avatarbilder
|
||||
|
||||
[Users]
|
||||
MaximumUID=1100
|
||||
HideUsers=mathieu
|
||||
" | sudo tee /etc/sddm.conf
|
||||
|
||||
sudo systemctl disable gdm
|
||||
sudo systemctl enable sddm
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
# ---------------------------------------------------------------------------
|
||||
# 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
|
||||
sddm
|
||||
firefox
|
||||
cups
|
||||
pipewire
|
||||
pipewire-session-manager
|
||||
qpwgraph
|
||||
cifs-utils
|
||||
|
||||
@aur
|
||||
catppuccin-sddm-theme-mocha
|
||||
+142
@@ -0,0 +1,142 @@
|
||||
#!/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
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Write SDDM configuration and switch display manager from gdm to sddm.
|
||||
# ---------------------------------------------------------------------------
|
||||
configure_sddm() {
|
||||
echo "==> Schreibe /etc/sddm.conf ..."
|
||||
echo "
|
||||
[General]
|
||||
Numlock=on
|
||||
|
||||
[Theme]
|
||||
ThemeDir=/usr/share/sddm/themes # Standardverzeichnis für Designvorlagen
|
||||
Current=catppuccin-mocha-blue # Standardthema
|
||||
CursorTheme=breeze_cursors # Mausthema
|
||||
FacesDir=/usr/share/sddm/faces # Verzeichnis für Avatarbilder
|
||||
|
||||
[Users]
|
||||
MaximumUID=1100
|
||||
HideUsers=mathieu
|
||||
" | sudo tee /etc/sddm.conf >/dev/null
|
||||
|
||||
echo "==> Deaktiviere gdm, aktiviere sddm ..."
|
||||
sudo systemctl disable gdm
|
||||
sudo systemctl enable sddm
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# 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
|
||||
|
||||
configure_sddm
|
||||
|
||||
echo "Fertig. Die Basis-Systemumgebung ist eingerichtet."
|
||||
}
|
||||
|
||||
main
|
||||
+2
-41
@@ -4,38 +4,6 @@ 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.
|
||||
# ---------------------------------------------------------------------------
|
||||
@@ -125,15 +93,8 @@ add_yazi_git_plugin() {
|
||||
# Main
|
||||
# ---------------------------------------------------------------------------
|
||||
main() {
|
||||
echo "==> Aktiviere multilib ..."
|
||||
enable_multilib
|
||||
|
||||
echo "==> System aktualisieren ..."
|
||||
sudo pacman -Syu
|
||||
|
||||
echo "==> Sicherstelle yay ..."
|
||||
install_yay
|
||||
|
||||
# Hinweis: multilib, yay und das System-Update werden von
|
||||
# basic/setup.sh uebernommen (laeuft vor term im Makefile).
|
||||
echo "==> Lese Paketliste: $PACKAGES_FILE"
|
||||
read_packages
|
||||
|
||||
|
||||
@@ -129,11 +129,13 @@ NOOP
|
||||
chmod +x "$HOME/bin/"*
|
||||
export PATH="$HOME/bin:$PATH"
|
||||
|
||||
# 2c. term/setup.sh package parsing sanity (mirrors read_packages).
|
||||
if ( cd "$REPO" && bash -n term/setup.sh ); then
|
||||
say_ok "term/setup.sh syntax OK"
|
||||
# 2c. setup.sh package parsing sanity (mirrors read_packages) for each
|
||||
# package dir: basic/term/utils.
|
||||
for d in basic term utils; do
|
||||
if ( cd "$REPO" && bash -n "$d/setup.sh" ); then
|
||||
say_ok "$d/setup.sh syntax OK"
|
||||
else
|
||||
say_fail "term/setup.sh syntax error"
|
||||
say_fail "$d/setup.sh syntax error"
|
||||
fi
|
||||
pacman_count=$(awk '
|
||||
/^@pacman/{s="pacman"}
|
||||
@@ -143,9 +145,10 @@ NOOP
|
||||
/^[[:space:]]*$/{next}
|
||||
s=="pacman"{pc++} s=="aur"{ac++} s=="npm"{nc++}
|
||||
END{printf "%d %d %d", pc,ac,nc}
|
||||
' $REPO/term/packages.txt)
|
||||
' "$REPO/$d/packages.txt")
|
||||
read -r PC AC NC <<< "$pacman_count"
|
||||
say_ok "packages.txt -> ${PC} pacman, ${AC} aur, ${NC} npm entries"
|
||||
say_ok "$d/packages.txt -> ${PC} pacman, ${AC} aur, ${NC} npm entries"
|
||||
done
|
||||
|
||||
# 2d. If network allowed and not skipped, actually install the pacman
|
||||
# section of term/setup.sh (mirrors `make term` without AUR/npm).
|
||||
|
||||
+16
-10
@@ -70,24 +70,30 @@ else
|
||||
fi
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# 4. packages.txt parsing sanity (mirrors term/setup.sh read_packages).
|
||||
# 4. packages.txt parsing sanity (mirrors each setup.sh read_packages).
|
||||
# ---------------------------------------------------------------------------
|
||||
echo "== Checking term/packages.txt markers =="
|
||||
if grep -q '^@pacman' term/packages.txt; then
|
||||
say_pass "packages.txt declares @pacman section"
|
||||
echo "== Checking packages.txt markers =="
|
||||
for pkgdir in term basic utils; do
|
||||
if ! [[ -f "$pkgdir/packages.txt" ]]; then
|
||||
say_fail "$pkgdir/packages.txt missing"
|
||||
continue
|
||||
fi
|
||||
if grep -q '^@pacman' "$pkgdir/packages.txt"; then
|
||||
say_pass "$pkgdir/packages.txt declares @pacman section"
|
||||
else
|
||||
say_fail "packages.txt missing @pacman marker"
|
||||
say_fail "$pkgdir/packages.txt missing @pacman marker"
|
||||
fi
|
||||
# every @aur/@npm marker must be matched by a real consumer in setup.sh
|
||||
for marker in '@aur' '@npm'; do
|
||||
if grep -q "^$marker" term/packages.txt; then
|
||||
grep -q "$marker" term/setup.sh \
|
||||
&& say_pass "packages.txt $marker handled by term/setup.sh" \
|
||||
|| say_fail "packages.txt uses $marker but term/setup.sh does not handle it"
|
||||
if grep -q "^$marker" "$pkgdir/packages.txt"; then
|
||||
grep -q "$marker" "$pkgdir/setup.sh" \
|
||||
&& say_pass "$pkgdir/packages.txt $marker handled by $pkgdir/setup.sh" \
|
||||
|| say_fail "$pkgdir/packages.txt uses $marker but $pkgdir/setup.sh does not handle it"
|
||||
else
|
||||
say_pass "packages.txt has no $marker section"
|
||||
say_pass "$pkgdir/packages.txt has no $marker section"
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# 5. Makefile <-> install script name consistency.
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
# ---------------------------------------------------------------------------
|
||||
# Standalone desktop utility package list for utils/setup.sh
|
||||
#
|
||||
# Programs that are not core to every branch, but are expected on a full
|
||||
# desktop: office / web / mail / native-app replacements (Wine), the
|
||||
# Nextcloud sync client, etc.
|
||||
#
|
||||
# - Lines starting with '#' and blank lines are ignored.
|
||||
# - Use "@pacman", "@aur" or "@npm" markers to switch section.
|
||||
# - The default section is @pacman.
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
@pacman
|
||||
nextcloud-client
|
||||
thunderbird
|
||||
ktouch
|
||||
ktorrent
|
||||
wine
|
||||
wine-mono
|
||||
wine-gecko
|
||||
winetricks
|
||||
rbw
|
||||
@@ -0,0 +1,74 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PACKAGES_FILE="$SCRIPT_DIR/packages.txt"
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# 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
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Main
|
||||
# ---------------------------------------------------------------------------
|
||||
main() {
|
||||
echo "==> Lese Paketliste: $PACKAGES_FILE"
|
||||
read_packages
|
||||
|
||||
install_pacman
|
||||
install_aur
|
||||
install_npm
|
||||
|
||||
echo "Fertig. Standalone Utilities sind eingerichtet."
|
||||
}
|
||||
|
||||
main
|
||||
Reference in New Issue
Block a user