Install fbterm
via your favorite package manager
pacman -S fbterm
Next you will need to grant a little bit of root to the fbterm executable so that it can do some magic with keyboards.
setcap 'cap_sys_tty_config+ep' $(command -v fbterm)
Finally you will need to add your user to the video
group so you can access
the device frame buffer /dev/fb0
usermod -aG video USERNAME
Running fbterm at login is easy, setting your shell variables is surprisingly
not. I find that it works best just appending values to your /etc/profile
rather than a new script in /etc/profile.d/
but I will probably revisit this
at a later date.
Add the code in profile to the end of /etc/profile
it sets a
flag so you can wrangle your $TERM
variable later, executes fbterm
for you
and injects a few color codes so that everything will render properly.
Next add the code in shellrc to your shell configurations
somewhere. It will help to auto-dectect and set your $TERM
variable
properly. If $TERM
is wrong, your colors won't work.
After installing fbterm and changing those config files you can just use normal color escapes in your display variables.
Configuration of fbterm
is handled by $HOME/.fbtermrc
which you should get a
default copy of.
I'm trying fbterm under Raspbian Lite on a Raspberry Pi. If I type fbterm from the tty, things work fine, and vim shows things with an extended color palette, unlike without fbterm, where I'm much more limited and certain colors do not display. So fbterm is compatible with my hardware, and the pi user already has the necessary permissions for things to work.
However, when I tried to add
exec fbterm
to /etc/profile and log back in, fbterm stopped seeing my keyboard. I could usealt-right
oralt-left
to switch tty's, where I could type in a username and login, but once fbterm launched, it would not respond to normal keystrokes.SysRq-r
would show[<uptime in secs.usecs>] sysrq: Keyboard mode set to system default
in the non-fbterm font.SysRq-e
would show rapid messages from killing fbterm and return to the login prompt, but the cursor underline would no longer appear and blink like normal. On the other hand, I could still type a username and login, only to get stuck in fbterm again.On a subsequent attempt, I tried keeping tty2 open, where I ran
sudo setcap 'cap_sys_tty_config+ep' $(command -v fbterm)
. Trying to login again on tty1 yielded the same result, except thatSysRq-e
now logged me out of all tty2 as well instead of just the current one.