-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInstallScript.sh
More file actions
executable file
·85 lines (66 loc) · 2.34 KB
/
InstallScript.sh
File metadata and controls
executable file
·85 lines (66 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
set -e # Skript bricht bei Fehlern ab
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Variablen
REPO_DIR="$HOME/dotfiles"
CONFIG_DIR="$HOME/.config"
ZSH_DIR="$HOME/.config/zsh"
# Array mit allen Package-Dateien
PACKAGE_FILES=(
"./packages.txt"
"./zsh_packages.txt"
)
# Prüfen, ob das Array leer ist
if [ ${#PACKAGE_FILES[@]} -eq 0 ]; then
echo "Keine Paket-Dateien gefunden. Abbruch."
exit 1
fi
# Installiere alle pakete
for FILE in "${PACKAGE_FILES[@]}"; do
if [[ -f "$FILE" ]]; then
echo "Installing packages from $FILE..."
sudo pacman -S --needed --noconfirm - < "$FILE"
else
echo "File $FILE not found, skipping."
fi
done
# Repo klonen in einen Temporären Ordner "~/dotfiles"
if [[ ! -d "$REPO_DIR" ]]; then
git clone https://github.com/orkansama/dotfiles.git "$REPO_DIR"
fi
# Zielordner .config erstellen falls noch nicht vorhanden
mkdir -p "$CONFIG_DIR"
# Kopiere Daten aus temp dotfiles-Ordner nach .config mit allen unterverzeichnissen (-r)
cp -r "$REPO_DIR/hypr" "$CONFIG_DIR/"
cp -r "$REPO_DIR/waybar" "$CONFIG_DIR/"
cp -r "$REPO_DIR/wofi" "$CONFIG_DIR/"
# Schiebe keyd files nach etc
sudo cp -r "$REPO_DIR/keyd" "/etc"
# Erstelle ein symlink von .config/zsh/.zshenv nach ~/ (.zshenv MUSS in Home sein)
ln -sf ~/.config/zsh/.zshenv ~/.zshenv
git clone https://github.com/ohmyzsh/ohmyzsh.git "$HOME/.config/zsh/ohmyzsh/"
cp -r "$REPO_DIR/zsh/." "$HOME/.config/zsh/"
# .git und .gitignore kopieren nach .config
sudo cp -r "$REPO_DIR/.git" "$CONFIG_DIR/"
sudo cp "$REPO_DIR/.gitignore" "/etc"
# Wenn alles erfolgreich war, temporären Ordner löschen
rm -rf "$REPO_DIR"
# Ändere die shell manuell
chsh -s $(which zsh)
# Installiere yay und die packete
sudo pacman -S --needed --noconfirm base-devel git && git clone https://aur.archlinux.org/yay.git && cd yay && makepkg -si --noconfirm
AUR_FILE="$SCRIPT_DIR/aur-packages.txt"
if [[ -f "$AUR_FILE" ]]; then
echo "Installing AUR packages..."
yay -S --needed --noconfirm \
--answerclean All \
--answerdiff None \
- < "$AUR_FILE"
fi
YAY_DIR="$SCRIPT_DIR/yay"
rm -rf "$YAY_DIR"
# Aktiviere Audio Permanent
systemctl --user enable --now pipewire pipewire-pulse wireplumber
# Aktiviere keyd Service Permanent
sudo systemctl enable keyd --now
echo "Installation abgeschlossen, dotfiles kopiert und Repo gelöscht!"