Skripte/Setup/6_Polish.sh

71 lines
2.6 KiB
Bash
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
# Waterfox-Installation
echo "🌍 Waterfox wird installiert..."
sudo install -d -m 0755 /etc/apt/keyrings
curl -fsSL https://download.opensuse.org/repositories/home:hawkeye116477:waterfox/Debian_12/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/home_hawkeye116477_waterfox.gpg > /dev/null
echo 'deb https://download.opensuse.org/repositories/home:/hawkeye116477:/waterfox/Debian_12/ /' | sudo tee /etc/apt/sources.list.d/home:hawkeye116477:waterfox.list
sudo apt update && sudo apt install -y waterfox-g
# 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!"