Tag Archives: gnome terminal

C64 Gnome Terminal

Create the file .bash_c64 in your home directory and populate with the following:

#!/usr/bin/env bash
export PS1=$
row=0
mem=$(grep MemTotal /proc/meminfo | awk '{print $2}')
mem=$((${mem}/1024))
free=$(( $(vmstat | sed '1,2d' | awk '{print $4}') * 4096 * 2))
text=("" "**** BASH $BASH_VERSION ****" "" "${mem}K RAM SYSTEM ${free} BASIC BYTES FREE" "")
clear
for f in "${text[@]}"; do
  columns=$(( ($(tput cols) - ${#f}) / 2))
  tput cup $(( row++ )) ${columns}
  echo "${f}"
done
echo "READY."

Now we'll source the file whenever a new terminal is opened. Open .bashrc and at the bottom enter the following:

source ~/.bash_c64

Next we'll install the c64 font. Download the file below and unpack to /home/<user>/.local/share/fonts

Now open the terminal preferences and create a new profile and configure the basic settings. I've chosen 49 chars wide purely for aesthetics but this will differ depending on your resources. The text will be centred regardless.

Now to define the colours. I set the defaults to the following values:

Text: #7c71da
Background: #3e32a2

Set the profile to be the default (optional) and close.
You'll need to close and reopen terminal and you should be presented with a c64esk termnial.

Gnome Terminal

Gnome terminal doesn't like to obey the "normal" locale file.  It uses "/etc/X11/gdm/locale.alias", and therefore usually has the incorrect character encoding.  eg.

instead of:

The way to solve this is to create a symlink to the correct locale.

1) Backup the original file:

mv /etc/X11/gdm/locale.alias /etc/X11/gdm/locale.alias.bak

2) Create the symlink:

ln -s /etc/locale.gen /etc/X11/gdm/locale.alias

It's also worth noting that I only have the following in my file:

en_GB ISO-8859-1
en_GB.UTF-8 UTF-8