Created
November 24, 2024 21:30
-
-
Save kenanpelit/46b12a62326b17f7a3aefb76db699ba6 to your computer and use it in GitHub Desktop.
font-ttf-hack-nerd-setup.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Root yetkisi kontrolü | |
if [ "$EUID" -ne 0 ]; then | |
echo "Bu script root yetkileri gerektiriyor." | |
echo "Lütfen 'sudo' ile çalıştırın." | |
exit 1 | |
fi | |
echo "Arch Linux font rendering kurulumu başlıyor..." | |
# Gerekli paketlerin yüklenmesi | |
echo "Gerekli paketler yükleniyor..." | |
pacman -S --needed --noconfirm freetype2 cairo fontconfig | |
# Font konfigürasyon dizini oluşturma | |
echo "Font konfigürasyon dizini oluşturuluyor..." | |
mkdir -p /etc/fonts | |
# Font konfigürasyon dosyasını oluşturma | |
echo "Font konfigürasyon dosyası oluşturuluyor..." | |
cat >/etc/fonts/local.conf <<'EOL' | |
<?xml version="1.0"?> | |
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"> | |
<fontconfig> | |
<match target="font"> | |
<edit name="antialias" mode="assign"> | |
<bool>true</bool> | |
</edit> | |
<edit name="hinting" mode="assign"> | |
<bool>true</bool> | |
</edit> | |
<edit name="hintstyle" mode="assign"> | |
<const>hintslight</const> | |
</edit> | |
<edit name="rgba" mode="assign"> | |
<const>rgb</const> | |
</edit> | |
<edit name="lcdfilter" mode="assign"> | |
<const>lcddefault</const> | |
</edit> | |
</match> | |
</fontconfig> | |
EOL | |
# Freetype özelliklerini ayarlama | |
echo "Freetype özellikleri ayarlanıyor..." | |
echo 'export FREETYPE_PROPERTIES="truetype:interpreter-version=40"' >/etc/profile.d/freetype2.sh | |
# Nerd Font kurulumu için paru kontrolü, yoksa yay | |
if command -v paru >/dev/null 2>&1; then | |
echo "Hack Nerd Font yükleniyor (paru ile)..." | |
sudo -u $SUDO_USER paru -S --noconfirm ttf-hack-nerd | |
elif command -v yay >/dev/null 2>&1; then | |
echo "Hack Nerd Font yükleniyor (yay ile)..." | |
sudo -u $SUDO_USER yay -S --noconfirm ttf-hack-nerd | |
else | |
echo "UYARI: paru veya yay bulunamadı. Hack Nerd Font manuel olarak yüklenmelidir." | |
fi | |
# Font önbelleğini güncelleme | |
echo "Font önbelleği güncelleniyor..." | |
fc-cache -f | |
echo "Kurulum tamamlandı!" | |
echo "Değişikliklerin etkili olması için oturumu yeniden başlatmanız önerilir." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment