diff --git a/post_installation_script/Nachinstallationsarbeiten_LC_Esslingen_XFCE.sh b/post_installation_script/Nachinstallationsarbeiten_LC_Esslingen_XFCE.sh index 73b805f..2b46cac 100644 --- a/post_installation_script/Nachinstallationsarbeiten_LC_Esslingen_XFCE.sh +++ b/post_installation_script/Nachinstallationsarbeiten_LC_Esslingen_XFCE.sh @@ -31,9 +31,7 @@ echo " # Das Skript bietet -teilweise interaktiv- die Installation von zusätzlichen Programmen an, die Linux Mint XFCE nicht standardmässig mitbringt. # # Folgende Dateien werden aus dem Skript referenziert und werden im selben Verzeichnis wie dieses Skript erwartet -## - Microsoft Aptos Fonts.zip -## - google-fonts.tar.gz -## - xfce4-panel.xml +## - xfce4-panel-profiles.tar.bz2 # # Zu Beginn werden die folgenden zusätzlichen Programme in einem Schritt installiert: # @@ -115,64 +113,58 @@ if question_answered_with_yes " ### Installiere Aptos Schriften? ###"; then echo echo "### Aptos Schriften ###" - _aptos_zip="Microsoft Aptos Fonts.zip" + _aptos_zip="/tmp/Microsoft Aptos Fonts.zip" _aptos_url="https://download.microsoft.com/download/8/6/0/860a94fa-7feb-44ef-ac79-c072d9113d69/Microsoft%20Aptos%20Fonts.zip" echo "Lade Aptos Schriften herunter..." wget "$_aptos_url" -O "$_aptos_zip" echo "Entpacke das Archiv..." - unzip -o "$_aptos_zip" + unzip -o "$_aptos_zip" -d /tmp/aptos_fonts echo "Erstelle /usr/share/fonts/truetype/aptos/" sudo mkdir -p /usr/share/fonts/truetype/aptos echo "Installiere alle .ttf Schriften..." - find . -name "*.ttf" -exec sudo install -m644 {} /usr/share/fonts/truetype/aptos/ \; 2>/dev/null || true + find /tmp/aptos_fonts -name "*.ttf" -exec sudo install -m644 {} /usr/share/fonts/truetype/aptos/ \; 2>/dev/null || true echo "Aktualisiere den Font-Cache" fc-cache -f echo "Fertig! Aptos Schriftarten sind installiert." echo "Entferne temporäre Dateien..." - rm -f "$_aptos_zip" + rm -rf "$_aptos_zip" /tmp/aptos_fonts fi echo echo -echo " ## freie Google-Schriften als Ersatz für aktuelle MS-Standardschriften installieren:" +echo " ## freie Google-Schriften" if question_answered_with_yes " ### Installiere Google Schriften? ###"; then echo echo "### Google Schriften ###" - - _gf="google-fonts" - fGoogleSchriften=./$_gf".tar.gz" - if [ ! -f "$fGoogleSchriften" ]; then - echo "" - echo "$fGoogleSchriften nicht gefunden." - echo " soll das Archiv "google-fonts.tar.gz" von Github heruntergeladen werden? Es ist ca. 1,4GB gross! " - if question_answered_with_yes " ### Download Google Schriften ###"; then - _wgeturl="https://github.com/google/fonts/archive/main.tar.gz" - echo "Connecting to Github server to download fonts..." - wget "$_wgeturl" -O "$_gf.tar.gz" + + _google_fonts_dir="/usr/share/fonts/truetype/google-fonts" + _google_fonts_url_base="https://gwfh.mranftl.com/api/fonts" + + _google_fonts="arimo carlito caladea inconsolata cousine libre-franklin neuton cabin oswald crimson-text lustria tinos league-spartan pt-sans" + + sudo mkdir -p "$_google_fonts_dir" + + for _font in $_google_fonts; do + echo "Lade $_font herunter..." + curl -s -o /tmp/"$_font".zip "${_google_fonts_url_base}/$_font?download=zip&subsets=latin,latin-ext&variants=regular,700" + if [ -s /tmp/"$_font".zip ] && head -c 2 /tmp/"$_font".zip | grep -q "PK"; then + unzip -o /tmp/"$_font".zip -d /tmp/"$_font"_fonts + sudo cp /tmp/"$_font"_fonts/fonts/"$_font"/* "$_google_fonts_dir/" 2>/dev/null || \ + sudo cp /tmp/"$_font"_fonts/* "$_google_fonts_dir/" 2>/dev/null || true + rm -rf /tmp/"$_font".zip /tmp/"$_font"_fonts + else + echo "Fehler: Download von $_font fehlgeschlagen, überspringe..." + rm -f /tmp/"$_font".zip fi - fi - if [ -f "$fGoogleSchriften" ]; then - echo - echo "Extracting the downloaded archive..." - tar -zxvf "$_gf.tar.gz" - echo "Creating the /usr/share/fonts/truetype/$_gf folder" - sudo mkdir -p /usr/share/fonts/truetype/$_gf - echo "Installing all .ttf fonts in /usr/share/fonts/truetype/$_gf" - find "$PWD/fonts-main/" -name "*.ttf" -exec sudo install -m644 {} /usr/share/fonts/truetype/google-fonts/ \; || echo "An error occured, please run this script again." - echo "Updating the font cache" - fc-cache -f - echo "Done. Now you can delete the tarball file $_gf.tar.gz if you wish." - - echo "Temporärer Fontordner wird gelöscht" - rm -r fonts-main - echo "Google-Schriften sind installiert. Die Anpassung der Standardschriften und/oder das Erstellen der Ersetzungstabelle in Libre Office muss manuell erfolgen, falls gewünscht." - else - echo "Schriften Fehlen immer noch. Manuell herunterladen und installieren" - fi - + done + + echo "Aktualisiere den Font-Cache" + fc-cache -f + echo "Fertig! Google Schriftarten sind installiert." + echo "Die Anpassung der Standardschriften und/oder das Erstellen der Ersetzungstabelle in Libre Office muss manuell erfolgen, falls gewünscht." fi # diff --git a/post_installation_script/README.md b/post_installation_script/README.md index 31e4340..210f4af 100644 --- a/post_installation_script/README.md +++ b/post_installation_script/README.md @@ -6,7 +6,8 @@ This directory contains files belonging to the Linux Mint XFCE post-installation - Linux Mint XFCE installed and running - Internet connection for downloading packages and updates - Script file: `Nachinstallationsarbeiten_LC_Esslingen_XFCE.sh` copied to Desktop -- External files are referenced by the script, please check header comments in the script + +No external files need to be pre-downloaded. ## Usage