Skip to content

aligrudi/fbpad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

352 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FBPAD
=====

Fbpad is a small Linux framebuffer virtual terminal.  It manages many
terminals through single-letter tags; each tag can hold two terminals.
The following table lists fbpad's key-bindings (m-k means pressing k,
while holding the alt key).  The list of tags or commands can be can
be configured in the ~/.fbpad file.

==============	=======================================
KEY		COMMAND
==============	=======================================
m-c		execute a shell (configured via ~/.fbpad)
m-;		like m-c but with switching signals
m-x 		switch to tag 'x' or execute command 'x'
m-j		switch to current tag's alternative terminal
m-k		like m-j
m-p		show tag summary
m-o		jump to the previous tag
m-tab		show the next terminal
m-s		create a text screenshot
m-y		redraw the terminal
c-m-e		reload .fbpad file
c-m-l		lock the screen; use PASS to unlock
c-m-o		disable/enable tag switching
c-m-q		quit fbpad
m-,		scroll up
m-.		scroll down
m-=		split tag horizontally/vertically
m--		unsplit tag
==============	=======================================

To execute a single program in fbpad, the program and its arguments
can be passed as command line arguments of fbpad.  Fbpad executes the
specified program in a terminal, disables all terminal switching
commands, and exits as soon as the program finishes.

Programs like fbpdf, fbvnc, and fbff read the FBDEV environment
variable, which can specify the framebuffer device and its drawing
region, like "/dev/fb0:1438x448+1+451".  Fbpad defines this
environment variable when executing a program, so that if a tag is
split, the program running in its terminal is limited to its
corresponding framebuffer region.

SETTING UP
==========

Fbpad reads $HOME/.fbpad file at startup.  The format of this file is
as follows:

  # Fonts: regular, italic, bold
  font    /path/to/0.tf /path/to/1.tf /path/to/2.tf

  # Tags list
  tags    xnlhtr01234uiva

  # Saved tags; it must be a subset of tags (the scrsnap feature)
  saved   ui

  # Other variables
  term    linux

  # Commands to execute with m-X; m-c and m-; execute a shell
  command c mksh
  command ; mksh

  # Text screenshot file path
  scrshot /tmp/scr

  # Lock screen password
  #pass    password

  # Quit confirmation key
  #quitkey x

  # Brighten bold text
  brighten 1

  # Foreground and background colors
  color   ffefef 333333

  # Basic 16-color palette
  color16 000000 ff5f87 00d787 cdcd00 00afff ff87df 00cdcd e5e5e5
          7f7f7f ff0000 00ff00 ffff00 5c5cff ff00ff 00ffff ffffff

  # Cursor color
  cursor  444444 ffbb55

  # Border color and width
  border  ffbb55 3

At least one font must be specified in the font line to use fbpad.
Two font formats are supported: fbpad's tinyfont and PSF2.  For
testing you can try https://dev.rudi.ir/courr.tf.  Tinyfont files can
be generated using fbpad_mkfn program (https://dev.rudi.ir/).

The saved line specifies the list tags that use fbpad's scrsnap
feature.  Framebuffer memory is saved and reloaded for terminals in
these tags, which is very convenient when using programs that modify
the framebuffer simultaneously, like fbpdf.

256-COLOR MODE
==============

Fbpad supports xterm's 256-color extension, but most programs will not
use this extension, unless the $TERM terminfo entry declares this
feature.  For this purpose, fbpad-256 terminfo file can be created to
contain (the two-space identation should be ignored):

  fbpad-256,
  	use=linux, U8#0,
  	colors#256,
  	pairs#32767,
  	setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m,
  	setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,

Which can be installed with tic command:

  $ tic -x ./fbpad-256

The following line should be added to shell's startup script:

  export TERM=fbpad-256

Note that in order to use this feature and italic fonts in Vim, adding
fbpad-256 terminfo is not necessary.  Including the following lines in
the vimrc file should enable them:

  set t_ZH=�[3m
  set t_Co=256

PERFORMANCE
===========

To improve text rendering performance in fbpad, you may redefine
fb_set() in pad.c based on the color depth and encoding of your
framebuffer.  For instance, if using a 32-bit little-endian RGB
framebuffer, you may redefine it as follows:

  static void fb_set(char *d, unsigned r, unsigned g, unsigned b)
  {
	d[0] = b;
	d[1] = g;
	d[2] = r;
  }

About

A Linux framebuffer terminal emulator

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 7