Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Feature : Setting Default TTY Fonts to Terminus Fonts #698

Merged
merged 24 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
1668bcc
Terminus Fonts TTY Setup
blusewill Sep 29, 2024
ac858de
Merge branch 'ChrisTitusTech:main' into main
blusewill Sep 29, 2024
b9b8b6f
Update the dectection of the Terminus Fonts
blusewill Sep 29, 2024
26eff44
Undo the Commit
blusewill Sep 29, 2024
2e02790
Update Fedora Path
blusewill Sep 29, 2024
45cf981
Fixing Fedora issues
blusewill Sep 29, 2024
b2d998b
Fix Fedora issues
blusewill Sep 29, 2024
3406f7b
Switch to another method
blusewill Sep 29, 2024
90b43fd
Fix Debian Message and Add Change to Terminus Font after Applied
blusewill Sep 29, 2024
7b1ff8a
Update tty command
blusewill Sep 29, 2024
91fd59f
Randomly trying things to see if it work or not
blusewill Sep 29, 2024
77c34a2
Adding Debug messages
blusewill Sep 29, 2024
3ba26ca
Remove Debug Command and specifiy tty terminal
blusewill Sep 29, 2024
4492326
Fix the setfont issue
blusewill Sep 29, 2024
f1436b2
Set only tty1 to terminus font
blusewill Sep 29, 2024
92c6a7b
Execute using sudo
blusewill Sep 29, 2024
3567d66
Remove Debug Messages
blusewill Sep 29, 2024
0d5bcab
Add comment for easy to understand
blusewill Sep 29, 2024
76cfea5
Update core/tabs/system-setup/tab_data.toml
blusewill Sep 29, 2024
04d8553
Update core/tabs/system-setup/tab_data.toml
blusewill Sep 29, 2024
f58b94a
Update the Docs and Fixing the Typo by @adamperkowski
blusewill Sep 29, 2024
d15adb7
From Utilitys to System Setup
blusewill Sep 29, 2024
c4dd29d
Update core/tabs/system-setup/tab_data.toml
blusewill Sep 30, 2024
c645a9f
Remove Comments
blusewill Sep 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions core/tabs/system-setup/tab_data.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,9 @@ name = "Remove Snaps"
description = "This script is designed to remove snap"
script = "remove-snaps.sh"
task_list = "RP"

[[data]]
name = "TTY Fonts"
description = "This Script will set the default TTY font to Terminus size 32 Bold"
script = "terminus-tty.sh"
task_list = "RP"
blusewill marked this conversation as resolved.
Show resolved Hide resolved
68 changes: 68 additions & 0 deletions core/tabs/system-setup/terminus-tty.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/bin/sh -e

. ../common-script.sh
InstallTermiusFonts() {
# Checking the Font is installed or not. By Checking the Font Files
blusewill marked this conversation as resolved.
Show resolved Hide resolved
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
blusewill marked this conversation as resolved.
Show resolved Hide resolved
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}"
# Setting Default TTY Fonts
blusewill marked this conversation as resolved.
Show resolved Hide resolved
"$ESCALATION_TOOL" sed -i 's/^FONT=.*/FONT=ter-v32b/' /etc/vconsole.conf
# Checking if is an X11 or Wayland Session
if [ -z "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ]; then
"$ESCALATION_TOOL" setfont -C /dev/tty1 ter-v32b
fi
blusewill marked this conversation as resolved.
Show resolved Hide resolved
printf "%b\n" "${GREEN}Terminus font set for TTY.${RC}"
;;
debian)
# Setting Default TTY Fonts
blusewill marked this conversation as resolved.
Show resolved Hide resolved
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}"
# After Edited the console-setup requires initramfs to be updated
blusewill marked this conversation as resolved.
Show resolved Hide resolved
"$ESCALATION_TOOL" update-initramfs -u
# Checking if is an X11 or Wayland Session
if [ -z "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ]; then
"$ESCALATION_TOOL" setfont -C /dev/tty1 /usr/share/consolefonts/Uni3-TerminusBold32x16.psf.gz
fi
blusewill marked this conversation as resolved.
Show resolved Hide resolved
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}"
# Setting Default TTY Fonts
"$ESCALATION_TOOL" sed -i 's/^FONT=.*/FONT=ter-v32b/' /etc/vconsole.conf
# Checking if is an X11 or Wayland Session
if [ -z "$DISPLAY" ] && [ -z "$WAYLAND_DISPLAY" ]; then
"$ESCALATION_TOOL" setfont -C /dev/tty1 ter-v32b
fi
blusewill marked this conversation as resolved.
Show resolved Hide resolved
printf "%b\n" "${GREEN}Terminus font has been set for TTY.${RC}"
;;
esac
}

checkEnv
InstallTermiusFonts
SetTermiusFonts
1 change: 1 addition & 0 deletions docs/userguide.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- **Gaming Setup**: Configures Steam, Lutris, etc.
- **Global Theming**: Sets up and manages global themes.
- **Remove Snaps**: Removes snap packages.
- **TTY Fonts**: This Script will set the default TTY font to Terminus size 32 Bold

### Arch Setup

Expand Down