1
0
Fork 0
mirror of https://github.com/kou029w/dotfiles.git synced 2025-01-18 16:07:59 +00:00

add install_source_han_mono_fonts function

This commit is contained in:
Nebel 2022-06-15 19:26:32 +09:00
parent 9962612c7d
commit c8b8dfa4c9
2 changed files with 32 additions and 0 deletions

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="pattern">
<test name="family">
<string>monospace</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Source Han Mono</string>
</edit>
</match>
</fontconfig>

View file

@ -16,8 +16,28 @@ function install_gsettings() {
dconf load "$gsettings_dir" dconf load "$gsettings_dir"
} }
function install_source_han_mono_fonts() {
local uid
local home
local fonts_dir
local fontconfig_dir
uid=${SUDO_UID:-$(id -u)}
home=$(eval "echo ~${SUDO_USER:-}")
fonts_dir="$home/.local/share/fonts"
fontconfig_dir="$home/.config/fontconfig/conf.d"
mkdir -p "$fonts_dir" "$fontconfig_dir"
sudo --user="#$uid" \
curl \
-fsSL https://github.com/adobe-fonts/source-han-mono/releases/download/1.002/SourceHanMono.ttc \
-o "$fonts_dir/SourceHanMono.ttc"
sudo --user="#$uid" \
rsync -rv fontconfig/ "$fontconfig_dir/"
fc-cache
}
(($(id -u) == 0)) \ (($(id -u) == 0)) \
&& [[ -f /etc/debian_version ]] \ && [[ -f /etc/debian_version ]] \
&& install_apt_packages && install_apt_packages
install_gsettings settings.ini / install_gsettings settings.ini /
install_gsettings terminal-settings.ini "/org/gnome/terminal/legacy/profiles:/:$(gsettings get org.gnome.Terminal.ProfilesList default | tr -d \')/" install_gsettings terminal-settings.ini "/org/gnome/terminal/legacy/profiles:/:$(gsettings get org.gnome.Terminal.ProfilesList default | tr -d \')/"
install_source_han_mono_fonts