ttyfonts - console fonts browser and selector
Posted: Tue Feb 02, 2016 10:38 am
This is to replace the console-setup script in Debian.
+ sets the fonts with preview on the fly
+ allows for additional non-Debian standard fonts
+ skips the keyboard map selector part
- only sets it temporarily for the active session (you can override this by adding a line that copies the selection to default.psf.gz)
Note: of course this only runs in a TTY.
+ sets the fonts with preview on the fly
+ allows for additional non-Debian standard fonts
+ skips the keyboard map selector part
- only sets it temporarily for the active session (you can override this by adding a line that copies the selection to default.psf.gz)
Code: Select all
#!/bin/bash
. /usr/share/doc/dialog/examples/setup-vars
. /usr/share/doc/dialog/examples/setup-tempfile
FONTLIST=/tmp/fontlist.$$$
ls -x1 /usr/share/consolefonts/*.gz > $FONTLIST
while true
do
ar=()
while read n s ; do
ar+=($n "$s")
done < $FONTLIST
dialog --clear --menu "Console Fonts" 0 0 0 "${ar[@]}" 2> $tempfile
retval=$?
case $retval in
$DIALOG_CANCEL)
exit 0;;
esac
setfont `cat $tempfile`
done