Skip to content

Instantly share code, notes, and snippets.

@zellio
Last active June 26, 2025 20:18
fbterm, installation and configuration hacks

fbterm setup and config hacks

Installation and setup

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

Run at login hacks

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.

&c.

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.

# hack for 256 color depth with fbterm
if [ "$TERM" = "linux" ]; then
echo -en "\e]P0222222" #black
echo -en "\e]P8222222" #darkgrey
echo -en "\e]P1803232" #darkred
echo -en "\e]P9982b2b" #red
echo -en "\e]P25b762f" #darkgreen
echo -en "\e]PA89b83f" #green
echo -en "\e]P3aa9943" #brown
echo -en "\e]PBefef60" #yellow
echo -en "\e]P4324c80" #darkblue
echo -en "\e]PC2b4f98" #blue
echo -en "\e]P5706c9a" #darkmagenta
echo -en "\e]PD826ab1" #magenta
echo -en "\e]P692b19e" #darkcyan
echo -en "\e]PEa1cdcd" #cyan
echo -en "\e]P7ffffff" #lightgrey
echo -en "\e]PFdedede" #white
FBTERM=1 exec fbterm
fi
#!/usr/bin/sh
case "$TERM" in
xterm*)
if [ -e /usr/share/terminfo/x/xterm-256color ]; then
export TERM=xterm-256color
elif [ -e /usr/share/terminfo/x/xterm-color ]; then
export TERM=xterm-color;
else
export TERM=xterm
fi
;;
linux)
[ -n "$FBTERM" ] && export TERM=fbterm
;;
esac
@chaimleib
Copy link

@nvillar no, not yet.

@timmypidashev
Copy link

Interesting, I am thinking of installing fbterm on the rpi myself, since I do not want to mess up my laptop install. I hope a workaround will be found soon.

@chaimleib
Copy link

I wonder now if the problem is a broken linkage between fbterm and the input-method program.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment