Skripte/Setup/6_Polish.sh

75 lines
2.8 KiB
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
set -e # Skript bricht bei Fehlern ab
# Sicherstellen, dass das Skript **nicht** als root ausgeführt wird
if [[ $EUID -eq 0 ]]; then
echo "Bitte **nicht** als root oder mit sudo ausführen! Das Skript fordert sudo nur dort an, wo es benötigt wird."
exit 1
fi
echo "🔄 System wird aktualisiert..."
sudo apt update && sudo apt install -y flatpak neovim ufw rfkill
sudo ufw enable
# Flatpak Flathub-Repo hinzufügen
sudo flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
# Firefox-Installation
echo "🌍 Firefox wird installiert..."
sudo install -d -m 0755 /etc/apt/keyrings
wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O /tmp/packages.mozilla.org.asc
gpg --dearmor < /tmp/packages.mozilla.org.asc | sudo tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/null
rm /tmp/packages.mozilla.org.asc
echo "deb [signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main" | sudo tee /etc/apt/sources.list.d/mozilla.list > /dev/null
echo -e 'Package: *\nPin: origin packages.mozilla.org\nPin-Priority: 1000' | sudo tee /etc/apt/preferences.d/mozilla > /dev/null
sudo apt update && sudo apt install -y firefox
# Hyprland User Bindings
HYPR_CONFIG_DIR="$HOME/.config/hypr/UserConfigs"
mkdir -p "$HYPR_CONFIG_DIR"
# Keybinds hinzufügen (falls nicht vorhanden)
declare -A KEYBINDS=(
["bindr = \$mainMod, \$mainMod_L, exec, pkill rofi || rofi -show drun -modi drun,filebrowser,run,window"]="rofi menu"
["bindr = \$mainMod, L, exec, \$scriptsDir/LockScreen.sh"]="screen lock"
["bindr = \$mainMod, V, exec, \$scriptsDir/ClipManager.sh"]="Clipboard Manager"
)
for BIND in "${!KEYBINDS[@]}"; do
if ! grep -Fxq "$BIND" "$HYPR_CONFIG_DIR/UserKeybinds.conf" 2>/dev/null; then
echo "$BIND # ${KEYBINDS[$BIND]}" >> "$HYPR_CONFIG_DIR/UserKeybinds.conf"
echo "✅ Keybind hinzugefügt: ${KEYBINDS[$BIND]}"
else
echo " Keybind existiert bereits: ${KEYBINDS[$BIND]}"
fi
done
# Standardvorlagen ablegen
echo "📂 Standardvorlagen werden im Vorlagen-Ordner erstellt..."
TEMPLATES_DIR="$HOME/Vorlagen"
mkdir -p "$TEMPLATES_DIR"
# Vorlagenliste
declare -A TEMPLATES=(
["Textdokument.txt"]="Dies ist eine Standard-Textdatei."
["Markdown-Dokument.md"]="# Markdown-Vorlage\n\nHier beginnt dein Markdown-Dokument."
["Bash-Skript.sh"]="#!/bin/bash\n\necho 'Hello, world!'"
["Python-Skript.py"]='#!/usr/bin/env python3\n\nprint("Hello, world!")'
)
for FILE in "${!TEMPLATES[@]}"; do
TEMPLATE_PATH="$TEMPLATES_DIR/$FILE"
if [[ ! -f "$TEMPLATE_PATH" ]]; then
echo -e "${TEMPLATES[$FILE]}" > "$TEMPLATE_PATH"
chmod +x "$TEMPLATE_PATH" # Falls Skript
echo "✅ Vorlage erstellt: $FILE"
else
echo " Vorlage existiert bereits: $FILE"
fi
done
echo "✅ Skript erfolgreich ausgeführt!"