Feat: Fügt LibreOffice-Templates hinzu.

This commit is contained in:
DragonSlayer_14 2025-02-24 13:07:18 +01:00
parent 4f1d2e2602
commit 9b0687eb1b

View File

@ -14,7 +14,7 @@ if ! command -v flatpak &>/dev/null; then
exit 1 exit 1
fi fi
# Flatpak Apps installieren (nur falls noch nicht vorhanden) # Flatpak Apps installieren (nur falls noch nicht als DEB installiert)
declare -A FLATPAK_APPS=( declare -A FLATPAK_APPS=(
["org.libreoffice.LibreOffice"]="LibreOffice" ["org.libreoffice.LibreOffice"]="LibreOffice"
["dev.vencord.Vesktop"]="Vesktop" ["dev.vencord.Vesktop"]="Vesktop"
@ -22,14 +22,46 @@ declare -A FLATPAK_APPS=(
) )
for APP in "${!FLATPAK_APPS[@]}"; do for APP in "${!FLATPAK_APPS[@]}"; do
if flatpak list | grep -q "$APP"; then if dpkg -l | grep -iq "${FLATPAK_APPS[$APP]}"; then
echo "${FLATPAK_APPS[$APP]} ist bereits installiert." echo "${FLATPAK_APPS[$APP]} ist bereits als DEB-Paket installiert."
elif flatpak list | grep -q "$APP"; then
echo "${FLATPAK_APPS[$APP]} ist bereits als Flatpak installiert."
else else
echo "🔄 Installiere ${FLATPAK_APPS[$APP]}..." echo "🔄 Installiere ${FLATPAK_APPS[$APP]} als Flatpak..."
flatpak install -y flathub "$APP" flatpak install -y flathub "$APP"
fi fi
done done
# Dynamischen Vorlagen-Ordner ermitteln
TEMPLATE_DIR=$(xdg-user-dir TEMPLATES 2>/dev/null || echo "$HOME/Vorlagen")
mkdir -p "$TEMPLATE_DIR"
# Prüfen, ob LibreOffice als Flatpak installiert ist
if flatpak list | grep -q "org.libreoffice.LibreOffice"; then
LO_CMD="flatpak run org.libreoffice.LibreOffice"
elif command -v libreoffice &>/dev/null; then
LO_CMD="libreoffice"
else
echo "❌ Fehler: LibreOffice ist weder als Flatpak noch als DEB-Paket installiert."
exit 1
fi
# LibreOffice-Vorlagen erstellen, falls nicht vorhanden
if [[ ! -f "$TEMPLATE_DIR/LibreOffice-Writer.ott" ]]; then
echo "🔄 Erstelle LibreOffice Writer-Vorlage..."
$LO_CMD --headless --convert-to ott --outdir "$TEMPLATE_DIR" /dev/null
else
echo "✅ LibreOffice Writer-Vorlage ist bereits vorhanden."
fi
if [[ ! -f "$TEMPLATE_DIR/LibreOffice-Calc.ots" ]]; then
echo "🔄 Erstelle LibreOffice Calc-Vorlage..."
$LO_CMD --headless --convert-to ots --outdir "$TEMPLATE_DIR" /dev/null
else
echo "✅ LibreOffice Calc-Vorlage ist bereits vorhanden."
fi
# Spotify-Installation # Spotify-Installation
echo "🎵 Überprüfe Spotify-Installation..." echo "🎵 Überprüfe Spotify-Installation..."
SPOTIFY_KEY="/etc/apt/trusted.gpg.d/spotify.gpg" SPOTIFY_KEY="/etc/apt/trusted.gpg.d/spotify.gpg"
@ -64,6 +96,7 @@ for dep in "${dependencies[@]}"; do
else else
echo "$dep ist bereits installiert." echo "$dep ist bereits installiert."
fi fi
done done
# Tealdeer (tldr-Client) installieren # Tealdeer (tldr-Client) installieren