term: 256-color support
[fbpad.git] / README
blob63d8633745645bd5c27a28a22f8f8c2804e3d6e2
1 FBPAD
2 =====
4 Fbpad is a small linux framebuffer virtual terminal.  It manages many
5 terminals through single-letter tags; each tag can hold two terminals.
6 The following table indicates fbpad's key-bindings (m-k means pressing k,
7 while holding the alt key).
9 ==============  =======================================
10 key             command
11 ==============  =======================================
12 m-c             execute a shell (SHELL)
13 m-m             execute mail program (MAIL)
14 m-e             execute editor program (EDITOR)
15 m-x             switch to tag 'x' (TAGS)
16 m-j             switch to alt terminal in this tag
17 m-k             like m-j
18 m-p             show tag summary
19 m-o             jump to last tag
20 m-tab           show next terminal
21 m-s             create a text screenshot (SCRSHOT)
22 m-y             redraw terminal
23 c-m-l           lock the screen; use PASS to unlock
24 c-m-q           quit fbpad
25 m-,             scroll up
26 m-.             scroll down
27 ==============  =======================================
29 Fbpad can be instructed to execute a single program: the program and
30 its arguments should passed as command line arguments of fbpad.  Fbpad
31 executes this program in a terminal, disables all terminal switching
32 commands, and exits as soon as the program finishes.
35 SETTING UP
36 ==========
38 To configure fbpad, you should edit config.h.  To get fbpad running
39 you need to make sure F0 points to a valid tinyfont file and SHELL to
40 the shell you want fbpad to execute.  Also the type of fbval_t should
41 match the framebuffer depth: unsigned char for 8-bit, short for 16-bit
42 and int for 24/32-bit framebuffers.  Once these are set, you should be
43 able to start fbpad without problems.
45 Fbpad uses tinyfont files, which can be created using ft2tf program
46 (http://litcave.rudi.ir/).  The FR, FI and FB macros specify the path
47 of the tinyfont files for regular, italic and bold fonts.  If FI or FB
48 is NULL, the regular font is used for italic or bold text.
50 Next you may want to change the list of fbpad tags by changing TAGS.
51 FGCOLOR and BGCOLOR macros specify foreground and background colors,
52 for instance the FGCOLOR of 2 and BGCOLOR of 0 creates green on black
53 terminals.  Individual colors can be customized by editing the hex RGB
54 color description of COLOR* macros.  Also SCRSHOT macro specifies where
55 fbpad text screenshots, as created using "m-s" command, should be saved.
57 If you are want to use fbpad's scrsnap feature, you can edit TAGS_SAVED
58 to change the list of saved terminals.  Framebuffer memory is saved and
59 reloaded for these tags, which is very convenient when you are using
60 programs that change the framebuffer simultaneously, like fbpdf.
62 256-COLOR MODE
63 ==============
65 Fbpad supports xterm's 256-color extension, but most programs will not
66 use this extension, unless the $TERM terminfo entry declares this
67 feature.  For this purpose, you need to create fbpad-256 terminfo file
68 containing (ignore the two-space identation):
70   fbpad-256,
71         use=linux, U8#0,
72         colors#256,
73         pairs#32767,
74         setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m,
75         setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,
77 And install it with:
79   $ tic -x ./fbpad-256
81 Now you can add this line to your shell startup script:
83   export TERM=fbpad-256
85 Note that in order to use this feature and italic fonts in Vim, adding
86 fbpad-256 terminfo is not necessary.  Including the following lines in
87 your vimrc should enable them:
89   set t_ve=\e[?25h
90   set t_vi=
91   set t_ZH=\e[3m
92   set t_Co=256