mirror of
https://github.com/phaleixo/after_install_debian_12.git
synced 2025-12-05 21:49:44 -03:00
Atualizar o fonts.sh
This commit is contained in:
parent
8c3ff56a33
commit
d3cde30c46
@ -9,88 +9,75 @@ echo "https://github.com/phaleixo/after_install_debian_12"
|
||||
|
||||
### Confirm script execution
|
||||
read -p "Do you want to proceed? (y/n): " response
|
||||
[[ "$response" != "y" ]] && inform "Operation canceled by the user." && exit 0
|
||||
[[ "$response" != "y" ]] && echo "Operation canceled by the user." && exit 0
|
||||
|
||||
### check if the distribution is compatible
|
||||
if [[ $(lsb_release -cs) = "bookworm" ]]
|
||||
then
|
||||
echo ""
|
||||
echo -e "\e[32;1mDebian 12 Distribution.\e[m"
|
||||
echo ""
|
||||
echo "Continuing with the script..."
|
||||
echo ""
|
||||
### Check if the distribution is compatible
|
||||
if [[ $(lsb_release -cs) = "bookworm" ]]; then
|
||||
echo -e "\n\e[32;1mDebian 12 Distribution.\e[m\n"
|
||||
else
|
||||
echo -e "\e[31;1mDistribution not approved for use with this script.\e[m"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
### check if there is an internet connection.
|
||||
if ping -q -c 3 -W 1 1.1.1.1 >/dev/null;
|
||||
then
|
||||
echo ""
|
||||
echo -e "\e[32;1mInternet connection OK.\e[m"
|
||||
echo ""
|
||||
echo "Continuing with the script..."
|
||||
echo ""
|
||||
### Check internet connection
|
||||
if ping -q -c 3 -W 1 1.1.1.1 >/dev/null; then
|
||||
echo -e "\n\e[32;1mInternet connection OK.\e[m\n"
|
||||
else
|
||||
echo -e "\e[31;1mYou are not connected to the internet. Check your network or Wi-Fi connection before proceeding.\e[m"
|
||||
echo -e "\e[31;1mNo internet connection.\e[m"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
### Prepare environment
|
||||
clear
|
||||
mkdir -p ~/.fonts
|
||||
|
||||
wget --version > /dev/null
|
||||
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "wget not available , installing"
|
||||
command -v wget >/dev/null || {
|
||||
echo "wget not found, installing..."
|
||||
sudo apt update && sudo apt install wget -y
|
||||
fi
|
||||
}
|
||||
|
||||
unzip >> /dev/null
|
||||
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "unzip not available , installing"
|
||||
command -v unzip >/dev/null || {
|
||||
echo "unzip not found, installing..."
|
||||
sudo apt update && sudo apt install unzip -y
|
||||
}
|
||||
|
||||
### Install Inter font (if not already installed)
|
||||
if ! fc-list | grep -iq "Inter"; then
|
||||
echo "Installing Inter font..."
|
||||
sudo apt install fonts-inter -y
|
||||
else
|
||||
echo "Inter font already installed."
|
||||
fi
|
||||
|
||||
|
||||
wget -O fonts.zip "https://github.com/mozilla/Fira/archive/refs/tags/4.202.zip"
|
||||
|
||||
wget -O firacode.zip "https://github.com/tonsky/FiraCode/releases/download/1.204/FiraCode_1.204.zip"
|
||||
|
||||
wget -O FontsForDesign.zip "https://github.com/phaleixo/after_install_debian_12/blob/main/src/Fonts%20for%20design.zip"
|
||||
|
||||
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "Downloading failed , exiting"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
unzip fonts.zip -d ~/.fonts
|
||||
unzip firacode.zip -d ~/.fonts
|
||||
### Download custom fonts for design (optional)
|
||||
wget -O FontsForDesign.zip "https://github.com/phaleixo/after_install_debian_12/blob/main/src/Fonts%20for%20design.zip?raw=true"
|
||||
unzip FontsForDesign.zip -d ~/.fonts
|
||||
|
||||
### Update font cache
|
||||
clear
|
||||
echo "purging fonts cache "
|
||||
sudo fc-cache -v -f
|
||||
clear
|
||||
echo "Done"
|
||||
sleep 2
|
||||
clear
|
||||
echo "Setting default fonts "
|
||||
echo "Purging fonts cache..."
|
||||
fc-cache -v -f
|
||||
|
||||
gsettings set org.gnome.desktop.interface document-font-name 'Fira Sans Regular 11'
|
||||
gsettings set org.gnome.desktop.interface font-name 'Fira Sans Regular 11'
|
||||
gsettings set org.gnome.desktop.interface monospace-font-name 'Fira Code Regular 11'
|
||||
gsettings set org.gnome.nautilus.desktop font 'Fira Sans Regular 11'
|
||||
gsettings set org.gnome.desktop.wm.preferences titlebar-font "Fira Sans SemiBold 12"
|
||||
clear
|
||||
### Set fonts based on DE
|
||||
echo "Setting default fonts..."
|
||||
|
||||
rm -rf fonts.zip
|
||||
rm -rf firacode.zip
|
||||
rm -rf FontsForDesign.zip
|
||||
if [[ $XDG_CURRENT_DESKTOP == *"GNOME"* ]]; then
|
||||
gsettings set org.gnome.desktop.interface document-font-name 'Inter Regular 10'
|
||||
gsettings set org.gnome.desktop.interface font-name 'Inter Regular 10'
|
||||
gsettings set org.gnome.desktop.interface monospace-font-name 'Inter Mono 10'
|
||||
gsettings set org.gnome.nautilus.desktop font 'Inter Regular 10'
|
||||
gsettings set org.gnome.desktop.wm.preferences titlebar-font "Inter SemiBold 11"
|
||||
echo "Fonts set for GNOME"
|
||||
elif [[ $XDG_CURRENT_DESKTOP == *"XFCE"* ]]; then
|
||||
xfconf-query -c xsettings -p /Gtk/FontName -s "Inter 10"
|
||||
xfconf-query -c xsettings -p /Gtk/MonospaceFontName -s "Inter Mono 10"
|
||||
echo "Fonts set for XFCE"
|
||||
else
|
||||
echo "Unknown desktop environment. Set fonts manually if needed."
|
||||
fi
|
||||
|
||||
echo -e "Fonts installed"
|
||||
### Cleanup
|
||||
rm -f FontsForDesign.zip
|
||||
|
||||
echo -e "\nFonts installed and configured successfully.\n"
|
||||
exit 0
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user