-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Feature : Setting Default TTY Fonts to Terminus Fonts (#698)
* Terminus Fonts TTY Setup * Update the dectection of the Terminus Fonts * Undo the Commit * Update Fedora Path * Fixing Fedora issues * Fix Fedora issues * Switch to another method * Fix Debian Message and Add Change to Terminus Font after Applied * Update tty command * Randomly trying things to see if it work or not * Adding Debug messages * Remove Debug Command and specifiy tty terminal * Fix the setfont issue * Set only tty1 to terminus font * Execute using sudo * Remove Debug Messages * Add comment for easy to understand * Update core/tabs/system-setup/tab_data.toml Co-authored-by: Adam Perkowski <[email protected]> * Update core/tabs/system-setup/tab_data.toml Co-authored-by: Adam Perkowski <[email protected]> * Update the Docs and Fixing the Typo by @adamperkowski * From Utilitys to System Setup * Update core/tabs/system-setup/tab_data.toml Co-authored-by: Adam Perkowski <[email protected]> * Remove Comments --------- Co-authored-by: Adam Perkowski <[email protected]>
- Loading branch information
1 parent
f85074f
commit 6c08422
Showing
3 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/bin/sh -e | ||
|
||
. ../common-script.sh | ||
InstallTermiusFonts() { | ||
if [ ! -f "/usr/share/kbd/consolefonts/ter-c18b.psf.gz" ] && | ||
[ ! -f "/usr/share/consolefonts/Uni3-TerminusBold18x10.psf.gz" ] && | ||
[ ! -f "/usr/lib/kbd/consolefonts/ter-p32n.psf.gz" ]; then | ||
printf "%b\n" "${YELLOW}Installing Terminus Fonts...${RC}" | ||
case "$PACKAGER" in | ||
pacman) | ||
"$ESCALATION_TOOL" "$PACKAGER" -S --needed --noconfirm terminus-font | ||
;; | ||
apt-get|nala) | ||
"$ESCALATION_TOOL" "$PACKAGER" install -y fonts-terminus | ||
;; | ||
dnf) | ||
"$ESCALATION_TOOL" "$PACKAGER" install -y terminus-fonts-console | ||
;; | ||
esac | ||
else | ||
printf "%b\n" "${GREEN}Terminus Fonts is already installed.${RC}" | ||
fi | ||
} | ||
|
||
SetTermiusFonts() { | ||
case "$DTYPE" in | ||
arch) | ||
printf "%b\n" "${YELLOW}Updating FONT= line in /etc/vconsole.conf...${RC}" | ||
"$ESCALATION_TOOL" sed -i 's/^FONT=.*/FONT=ter-v32b/' /etc/vconsole.conf | ||
if [ -z "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ]; then | ||
"$ESCALATION_TOOL" setfont -C /dev/tty1 ter-v32b | ||
fi | ||
printf "%b\n" "${GREEN}Terminus font set for TTY.${RC}" | ||
;; | ||
debian) | ||
|
||
printf "%b\n" "${YELLOW}Updating console-setup configuration...${RC}" | ||
"$ESCALATION_TOOL" sed -i 's/^CODESET=.*/CODESET="guess"/' /etc/default/console-setup | ||
"$ESCALATION_TOOL" sed -i 's/^FONTFACE=.*/FONTFACE="TerminusBold"/' /etc/default/console-setup | ||
"$ESCALATION_TOOL" sed -i 's/^FONTSIZE=.*/FONTSIZE="16x32"/' /etc/default/console-setup | ||
printf "%b\n" "${GREEN}Console-setup configuration updated for Terminus font.${RC}" | ||
# Editing console-setup requires initramfs to be regenerated | ||
"$ESCALATION_TOOL" update-initramfs -u | ||
if [ -z "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ]; then | ||
"$ESCALATION_TOOL" setfont -C /dev/tty1 /usr/share/consolefonts/Uni3-TerminusBold32x16.psf.gz | ||
fi | ||
printf "%b\n" "${GREEN}Terminus font has been set for TTY.${RC}" | ||
;; | ||
fedora) | ||
printf "%b\n" "${YELLOW}Updating FONT= line in /etc/vconsole.conf...${RC}" | ||
"$ESCALATION_TOOL" sed -i 's/^FONT=.*/FONT=ter-v32b/' /etc/vconsole.conf | ||
if [ -z "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ]; then | ||
"$ESCALATION_TOOL" setfont -C /dev/tty1 ter-v32b | ||
fi | ||
printf "%b\n" "${GREEN}Terminus font has been set for TTY.${RC}" | ||
;; | ||
esac | ||
} | ||
|
||
checkEnv | ||
InstallTermiusFonts | ||
SetTermiusFonts |
This file contains 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