Skip to content

Commit

Permalink
plymouth: Change default fonts (#164)
Browse files Browse the repository at this point in the history
* Remove Ubuntu watermark

* Change default fonts

* Fix whitespace

* Add new line

* Make Roboto Mono the default mono font
  • Loading branch information
meisenzahl authored and danirabbit committed Dec 22, 2022
1 parent 8de59cb commit 9fc1d61
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions debian/local/plymouth.hook
Original file line number Diff line number Diff line change
Expand Up @@ -120,30 +120,31 @@ case "${THEME_NAME}" in
;;

*)
cp /usr/share/plymouth/ubuntu-logo.png "${DESTDIR}/usr/share/plymouth"
if [ -d ${DESTDIR}/usr/share/plymouth/themes/spinner ]; then
cp /usr/share/plymouth/ubuntu-logo.png "${DESTDIR}/usr/share/plymouth/themes/spinner/watermark.png"
fi

# fontconfig
mkdir -p "${DESTDIR}/etc/fonts/conf.d"
cp -a /etc/fonts/fonts.conf "${DESTDIR}/etc/fonts"
mkdir -p "${DESTDIR}/var/cache/fontconfig"
# This is only needed because fc-cache bellow fails if the directory doesn't exist
mkdir -p "${DESTDIR}/usr/local/share/fonts"

# Make Ubuntu the default sans-serif, and mono fonts. Ubuntu
# font is always present if we have python-label installed; if
# not installed, then we have no graphical themes that display
# text, so that's ok.
if [ -e /usr/share/fonts/truetype/ubuntu/Ubuntu-R.ttf ]
cp /etc/fonts/conf.d/60-latin.conf "${DESTDIR}/etc/fonts/conf.d/60-latin.conf"

# Make Inter the default sans-serif font
if [ -e /usr/share/fonts/opentype/inter/Inter-Regular.otf ]
then
sed 's|\(<family>DejaVu Sans</family>\)|<family>Ubuntu</family>\1|;s|\(<family>DejaVu Sans Mono</family>\)|<family>Ubuntu Mono</family>\1|;' \
/etc/fonts/conf.d/60-latin.conf > "${DESTDIR}/etc/fonts/conf.d/60-latin.conf"
mkdir -p "${DESTDIR}/usr/share/fonts/truetype/ubuntu"
cp -a /usr/share/fonts/truetype/ubuntu/Ubuntu-R.ttf "${DESTDIR}/usr/share/fonts/truetype/ubuntu"
cp -a /usr/share/fonts/truetype/ubuntu/UbuntuMono-R.ttf "${DESTDIR}/usr/share/fonts/truetype/ubuntu"
sed -i 's|\(<family>DejaVu Sans</family>\)|<family>Inter</family>\1|;' "${DESTDIR}/etc/fonts/conf.d/60-latin.conf"
mkdir -p "${DESTDIR}/usr/share/fonts/opentype/inter"
cp -a /usr/share/fonts/opentype/inter/Inter-Regular.otf "${DESTDIR}/usr/share/fonts/opentype/inter"
fi

# Make Roboto Mono the default mono font
if [ -e /usr/share/fonts/truetype/roboto-mono-elementary/RobotoMono-Regular.ttf ]
then
sed -i 's|\(<family>DejaVu Sans Mono</family>\)|<family>Roboto Mono</family>\1|;' "${DESTDIR}/etc/fonts/conf.d/60-latin.conf"
mkdir -p "${DESTDIR}/usr/share/fonts/truetype/roboto-mono-elementary"
cp -a /usr/share/fonts/truetype/roboto-mono-elementary/RobotoMono-Regular.ttf "${DESTDIR}/usr/share/fonts/truetype/roboto-mono-elementary"
fi

fc-cache -s -y "${DESTDIR}" > /dev/null 2>&1

# copy /etc/default/keyboard (needed for keymap detection)
Expand Down

0 comments on commit 9fc1d61

Please sign in to comment.