Difference between revisions of "Fbpad"

From ArchWiki
Jump to: navigation, search
m
(20 intermediate revisions by 5 users not shown)
Line 1: Line 1:
[[Category:Terminal emulators (English)]]
+
{{DISPLAYTITLE:fbpad}}
{{i18n|fbpad}}
+
[[Category:Terminal emulators]]
 
{{Article summary start|Summary}}
 
{{Article summary start|Summary}}
 
{{Article summary text|Information on installing, configuring, and using fbpad}}
 
{{Article summary text|Information on installing, configuring, and using fbpad}}
 
{{Article summary end}}
 
{{Article summary end}}
{{DISPLAYTITLE:fbpad}}
 
 
   
 
   
[http://repo.or.cz/w/fbpad.git fbpad] is a small framebuffer terminal that manages many terminals through single character tags. It is exceptionally lightweight, being written in C and using its own font format, tinyfont, which avoids xorg font dependencies. fbpad optionally supports 256 colors, bold fonts, and saving the framebuffer contents to memory, all which combined make fbpad a viable alternative to the X server for many purposes.
+
[http://repo.or.cz/w/fbpad.git fbpad] is a small framebuffer terminal that manages many terminals through single character tags. It is exceptionally lightweight, being written in C and using its own font format, tinyfont, which avoids [[xorg]] font dependencies. fbpad optionally supports 256 colors, bold fonts, and saving the framebuffer contents to memory, all which combined make fbpad a viable alternative to the [[X]] server for many purposes.
  
 
==Installation==
 
==Installation==
  
fbpad can be installed from the [http://aur.archlinux.org/packages.php?ID=53002 AUR], which by default imports the "bold" and "scrsnap" branches of fbpad, which add in 256-colors and bold fonts, and saving the contents of the framebuffer, respectively. fbpad is customized via the {{Filename|config.h}} file, and edits to the {{Filename|config.h}} file are incorporated into fbpad after recompiling fbpad, using the command {{codeline|makepkg --skipinteg -i}}.  
+
{{AUR|fbpad-git}} can be installed from the [[Arch User Repository|AUR]], which by default imports the "bold" and "scrsnap" branches of fbpad, which add in 256-colors and bold fonts, and saving the contents of the framebuffer, respectively. fbpad is customized via a {{ic|config.h}} file, and edits to the {{ic|config.h}} file are incorporated into fbpad after recompiling fbpad, using the command {{ic|makepkg --skipinteg -i}}.  
  
 
==Configuration==
 
==Configuration==
  
Users most likely will want to edit the definitions in the {{Filename|config.h}} for fonts (more on this later), {{codeline|SHELL}}, {{codeline|MAIL}}, and {{codeline|EDITOR}} prior to use, to their preferred programs.
+
Users most likely will want to edit the definitions in the {{ic|config.h}} for fonts (more on this later), {{ic|SHELL}}, {{ic|MAIL}}, and {{ic|EDITOR}} prior to use, to their preferred programs.
  
The following patch enables defining programs in the {{Filename|config.h}} that have arguments:
+
[[dwm]] users should have no problems accustoming to fbpad. fbpad-specific keybindings are initiated with the modifier key, which is hardcoded as the {{ic|Alt}} key, just like in dwm. {{ic|Alt+j}} and {{ic|Alt+k}} switch between terminals in an open tag, {{ic|Alt+o}} switches to the last open tag, and {{ic|Alt+p}} shows the list of open tags, to name a few. Users comfortable with manually patching source code can edit the {{ic|fbpad.c}} file to edit/add keybindings.
  
<pre>
+
If you re-compile fbpad often, you would probably like to be able to reload fbpad without having to manually re-launch it. The following code starts fbpad post login in tty1 and will reload it if you quit fbpad with {{ic|Ctrl+Alt+q}}.
diff --git a/term.c b/term.c
+
index 08355d6..bd79757 100644
+
--- a/term.c
+
+++ b/term.c
+
@@ -301,11 +301,11 @@ void term_exec(char *cmd)
+
return;
+
if (!term->pid) {
+
char *envp[MAXENV] = {"TERM=linux"};
+
- char *argv[2] = {cmd};
+
+ char *argv[] = {"sh", "-c", cmd, NULL};
+
envcpy(envp + 1, environ);
+
_login(slave);
+
close(master);
+
- execvep(cmd, argv, envp);
+
+ execvep(argv[0], argv, envp);
+
exit(1);
+
}
+
close(slave);
+
  
</pre>
+
{{bc|<nowiki>
 
+
Save the patch as {{Filename|fbpad-spaces.diff}}, add {{codeline|'fbpad-spaces.diff'}} to your source array, and the following line to the {{Filename|PKGBUILD}} after the line that copies the {{Filename|config.h}} file:
+
 
+
patch -p1 -i "${srcdir}/${_gitname}-spaces.diff" || return 1
+
 
+
[[dwm]] users should have no problems accustoming to fbpad. fbpad-specific keybindings are initiated with the modifier key, which is hardcoded as the {{Keypress|Alt}} key, just like in dwm. {{Keypress|Alt}} + {{Keypress|j}} and {{Keypress|Alt}} + {{Keypress|k}} switch between terminals in an open tag, {{Keypress|Alt}} + {{Keypress|o}} switches to the last open tag, and {{Keypress|Alt}} + {{Keypress|p}} shows the list of open tags, to name a few. Users comfortable with patching source code can edit the {{Filename|fbpad.c}} file to edit/add keybindings.
+
 
+
If you re-compile fbpad often, you would probably like to be able to reload fbpad without having to manually re-launch it. The following code starts fbpad post login in tty1 and will reload it if you quit fbpad with {{Keypress|Ctrl}} + {{Keypress|Alt}} + {{Keypress|q}}.
+
 
+
<pre>
+
 
if [[ $(tty) = /dev/tty1 ]]; then
 
if [[ $(tty) = /dev/tty1 ]]; then
 
   while true; do
 
   while true; do
Line 54: Line 25:
 
   done
 
   done
 
fi
 
fi
</pre>
+
</nowiki>}}
  
 
Place this at the end of your shellrc file.
 
Place this at the end of your shellrc file.
Line 62: Line 33:
 
The default background of the list of tags is hardcoded as white, the foreground of empty tags as black, the foreground of fully occupied tags as green (each tag may contain two terminals), and the foreground of tags that are not fully occupied as blue. This color scheme clearly is not for everyone, but this is easily remedied with the following patch:
 
The default background of the list of tags is hardcoded as white, the foreground of empty tags as black, the foreground of fully occupied tags as green (each tag may contain two terminals), and the foreground of tags that are not fully occupied as blue. This color scheme clearly is not for everyone, but this is easily remedied with the following patch:
  
<pre>
+
{{bc|1=
 
--- a/fbpad.c 2011-11-11 13:02:22.834825518 -0500
 
--- a/fbpad.c 2011-11-11 13:02:22.834825518 -0500
 
+++ b/fbpad.c 2011-11-11 13:04:07.016043271 -0500
 
+++ b/fbpad.c 2011-11-11 13:04:07.016043271 -0500
Line 83: Line 54:
 
  pad_put(tags[i], r, c++, colors[nt], BGCOLOR);
 
  pad_put(tags[i], r, c++, colors[nt], BGCOLOR);
 
  pad_put(i == ctag ? ')' : ' ', r, c++, FGCOLOR, BGCOLOR);
 
  pad_put(i == ctag ? ')' : ' ', r, c++, FGCOLOR, BGCOLOR);
</pre>
+
}}
  
To use, replace "8" with the desired color for empty tags (in both instances), "2" with the desired color for not fully occupied tags, and "9" with the desired color for fully occupied tags, where the colors 0-15 are defined in the {{Filename|config.h}} file. This patch also makes the default background color the background color of your terminal, which the writer finds to be a more natural choice.
+
To use, replace "8" with the desired color for empty tags (in both instances), "2" with the desired color for not fully occupied tags, and "9" with the desired color for fully occupied tags, where the colors 0-15 are defined in the {{ic|config.h}} file. This patch also makes the default background color the background color of your terminal, which the writer finds to be a more natural choice.
  
Note that the second "8" is the color for tags for which fbpad saves the framebuffer contents. If you choose to leave {{codeline|TAGS_SAVED}} defined as {{codeline|TAGS}}, then you will want your default foreground color and the color for saved tags to be the same, i.e. "8" in both instances. Otherwise, you may define {{codeline|TAGS_SAVED}} as a concatenated string of the tags to be saved, and change the second "8" to the color you wish to indicate saved tags by. The writer herself saves all tags for convenience.  
+
Note that the second "8" is the color for tags for which fbpad saves the framebuffer contents. If you choose to define {{ic|TAGS_SAVED}} as {{ic|TAGS}}, then you will want your default foreground color and the color for saved tags to be the same, i.e. "8" in both instances. Otherwise, you may define {{ic|TAGS_SAVED}} as a concatenated string of the tags to be saved, and change the second "8" to the color you wish to indicate saved tags by. The writer herself saves all tags for convenience.  
  
Save the patch as {{Filename|fbpad-tagcolor.diff}}, add {{codeline|'fbpad-tagcolor.diff'}} to your source array, and the following line to the {{Filename|PKGBUILD}} after the line that copies the {{Filename|config.h}} file:
+
Save the patch as {{ic|fbpad-tagcolor.diff}}, add {{ic|'fbpad-tagcolor.diff'}} to your source array, and the following line to the {{ic|PKGBUILD}} after the line that copies the {{ic|config.h}} file:
  
 
  patch -p1 -i "${srcdir}/${_gitname}-tagcolor.diff" || return 1
 
  patch -p1 -i "${srcdir}/${_gitname}-tagcolor.diff" || return 1
Line 95: Line 66:
 
===Fonts===
 
===Fonts===
  
The font format for fbpad is the "tinyfont", and there exists a utility, {{AUR|ft2tf}}, which converts TTF files to the tinyfont format. You will need to edit the {{Filename|config.h}} file in the ft2tf build directory to point to the TTF file of your desired font. For instance, if the font file {{Filename|MonteCarloFixed.ttf}} was located in {{Filename|$HOME/.fonts}} directory, you would edit line 10 of the {{Filename|config.h}} to look like the following:
+
The font format for fbpad is the "tinyfont", and there exists a utility, {{AUR|ft2tf}}, which converts TTF files to the tinyfont format. You will need to edit the {{ic|config.h}} file in the ft2tf build directory to point to the TTF file of your desired font. For instance, if the font file {{ic|MonteCarloFixed.ttf}} was located in {{ic|$HOME/.fonts}} directory, you would edit line 10 of the {{ic|config.h}} to look like the following:
  
 
  {"/home/archie/.fonts/MonteCarloFixed12.ttf", 6},
 
  {"/home/archie/.fonts/MonteCarloFixed12.ttf", 6},
Line 101: Line 72:
 
if your username was "archie", and the font size of Monte Carlo you wished to create was size 6. Delete other font lines you see other than this one, unless you wish to supplement your font with the glyphs from another font, in which case, add lines like the one above for your other TTF fonts.
 
if your username was "archie", and the font size of Monte Carlo you wished to create was size 6. Delete other font lines you see other than this one, unless you wish to supplement your font with the glyphs from another font, in which case, add lines like the one above for your other TTF fonts.
  
Then, run {{codeline|makepkg -skipinteg -i}} to rebuild and reinstall the package with your customized settings.
+
Then, run {{ic|makepkg -skipinteg -i}} to rebuild and reinstall the package with your customized settings.
  
 
After installing ft2tf, the following command creates a tinyfont file:
 
After installing ft2tf, the following command creates a tinyfont file:
Line 109: Line 80:
 
where "MyFont" can be replaced with a name of your choosing.
 
where "MyFont" can be replaced with a name of your choosing.
  
Remember to edit your {{Filename|config.h}} to point to the directory where you save your {{Filename|MyFont.tf}}. If your font also has a bold face, repeat the process of editing the ft2tf {{Filename|config.h}} file, this time specifying the location of the boldface TTF file in the ft2tf {{Filename|config.h}}, rebuilding with makepkg, and adding the final boldface tinyfont location to your fbpad {{Filename|config.h}}.
+
Remember to edit your {{ic|config.h}} to point to the directory where you save your {{ic|MyFont.tf}}. If your font also has a bold face, repeat the process of editing the ft2tf {{ic|config.h}} file, this time specifying the location of the boldface TTF file in the ft2tf {{ic|config.h}}, rebuilding with makepkg, and adding the final boldface tinyfont location to your fbpad {{ic|config.h}}.
  
Also note that some fonts might require modification of the {{codeline|WIDTHDIFF}} and {{codeline|HEIGHTDIFF}} to have the proper width and height, respectively.
+
Also note that some fonts might require modification of the {{ic|WIDTHDIFF}} and {{ic|HEIGHTDIFF}} to have the proper width and height, respectively.
  
 
===Color Support===
 
===Color Support===
  
By default, the AUR package installs the custom terminfo for fbpad, but you will need to add <pre>export TERM=fbpad-256</pre> to your shellrc to take advantage of the color support. Clearly, commands not spawned in your default shell (for instance, those for {{codeline|EDITOR}} and {{codeline|MAIL}}) will not read your shellrc file, so you will need to edit their definitions in your {{Filename|config.h}} file to have the commands for {{codeline|EDITOR}} and {{codeline|MAIL}} run in a parent shell. For instance, the author of this article, who uses [[zsh]], changed the default command for {{codeline|MAIL}} from:
+
By default, the AUR package installs the custom terminfo for fbpad, but you will need to add {{bc|1=export TERM=fbpad-256}} to your shellrc to take advantage of the 256 color support. Clearly, commands not spawned in your default shell (for instance, those for {{ic|EDITOR}} and {{ic|MAIL}}) will not read your shellrc file, so you will need to edit their definitions in your {{ic|config.h}} file to have the commands for {{ic|EDITOR}} and {{ic|MAIL}} run in a parent shell. For instance, the author of this article, who uses [[zsh]], changed the default command for {{ic|MAIL}} from:
  
 
  #define MAIL "mailx"
 
  #define MAIL "mailx"
Line 123: Line 94:
 
  #define MAIL "zsh -i -c mailx"
 
  #define MAIL "zsh -i -c mailx"
  
taking advantage of the above patch that enabled commands with arguments in the {{Filename|config.h}} file.
+
Additionally, to have colors with the {{ic|ls}} command, "fbpad-256" needs to be added to the list of terms that {{ic|ls}} knows can handle color. Per the {{ic|README}}, run the following command in your shell:
 
+
Additionally, to have colors with the {{codeline|ls}} command, "fbpad-256" needs to be added to the list of terms that {{codeline|ls}} knows can handle color. Per the {{Filename|README}}, run the following command in your shell:
+
  
 
  $ dircolors --print-database | sed '/^TERM linux$/aTERM fbpad-256' >$HOME/.dircolors
 
  $ dircolors --print-database | sed '/^TERM linux$/aTERM fbpad-256' >$HOME/.dircolors
  
and add {{codeline|eval `dircolors ~/.dircolors`}} to your shellrc file so that the custom dircolors file, with the fbpad-256 term added, may be loaded.
+
and add {{ic|eval `dircolors ~/.dircolors`}} to your shellrc file so that the custom dircolors file, with the fbpad-256 term added, may be loaded.
  
 
==Usage==
 
==Usage==
Line 137: Line 106:
 
===Copying Text===
 
===Copying Text===
  
As everything is done mouselessly in fbpad, to copy text, users can make a "screenshot" of all the text on the screen with the {{Keypress|Alt} + {Keypress|s}} command. This will save all viewable text to the file {{Filename|/tmp/scr}}. Then, if your shell supports editing the commandline with [[vim]] (for instance, the edit-command-line ZLE function in zsh), you can open the {{Filename|/tmp/scr}} file as a new buffer in vim and use its copy keybindings to paste the needed text into your original buffer. [[Emacs]] users probably can adopt a similar scheme to copy text.
+
As everything is done mouselessly in fbpad, to copy text, users can make a "screenshot" of all the text on the screen with the {{ic|Alt+s}} command. This will save all viewable text to the file {{ic|/tmp/scr}}. Then, if your shell supports editing the commandline with [[vim]] (for instance, the edit-command-line ZLE function in zsh), you can open the {{ic|/tmp/scr}} file as a new buffer in vim and use its copy keybindings to paste the needed text into your original buffer. [[Emacs]] users probably can adopt a similar scheme to copy text.
  
 
===Watching YouTube===
 
===Watching YouTube===
  
If one is using [[mplayer]] with the {{codeline|-vo=fbdev2}} option, {{AUR|youtube-viewer}} is available in the AUR for searching YouTube and watching with mplayer from the commandline. Alternatively, one can add the following script as an external browser in the commandline web browser {{Pkg|w3m}}, and launch playback of videos from YouTube websites with your media player of choice. The script below employs {{AUR|fbff-git}}, a lightweight media player also written by the author of fbpad, and {{AUR|yturl}}, a simple program, that, rather UNIX-like, functions solely to convert YouTube URLs into directly watchable URLs.
+
If one is using [[MPlayer]] with the video output driver set to {{ic|fbdev2}}, {{AUR|youtube-viewer}} can be used for searching YouTube and watching with MPlayer from the commandline in fbpad. Alternatively, one can add the following script as an external browser in the commandline web browser {{Pkg|w3m}}, and launch playback of videos from YouTube websites with one's media player of choice. The script below employs {{AUR|fbff-git}}, a lightweight media player also written by the author of fbpad, and {{AUR|yturl}}, a simple program, that, rather UNIX-like, functions solely to convert YouTube URLs into directly watchable URLs.
  
<pre>
+
{{bc|1=
 
#!/bin/sh
 
#!/bin/sh
 
video=$(yturl $1)
 
video=$(yturl $1)
 
fbff -f $video > /dev/null 2>&1
 
fbff -f $video > /dev/null 2>&1
</pre>
+
}}
  
Save the file in your {{codeline|PATH}} as {{Filename|youtube.sh}}, and add it as an external browser to w3m by opening w3m, hitting the {{Keypress|o}} key to edit options, and edit the "External Browser" field under "External Program Settings" by entering in the field "youtube.sh". Hit "OK", and you are done. Now, when wishing to watch a video, with YouTube open, hit the {{Keypress|M}} key, and the video will begin streaming instantly in fbff.
+
Save the file in your {{ic|PATH}} as {{ic|youtube.sh}}, and add it as an external browser to w3m by opening w3m, hitting the {{ic|o}} key to edit options, and edit the "External Browser" field under "External Program Settings" by entering in the field "youtube.sh". Hit "OK", and you are done. Now, when wishing to watch a video, with YouTube open, hit the {{ic|M}} key, and the video will begin streaming instantly in fbff.
  
 
==Recommended Programs==
 
==Recommended Programs==
  
Here are a few recommendations for programs that significantly enhance the usability of fbpad:
+
Here are a few recommendations for programs that enhance the usability of a framebuffer-based desktop:
  
* {{AUR|cnoor-git}} - a holy Quran viewer, using pango for rendering
 
 
* {{Pkg|dvtm}} - a dynamic virtual terminal manager (think dwm, but for the console)
 
* {{Pkg|dvtm}} - a dynamic virtual terminal manager (think dwm, but for the console)
 
* {{AUR|fbcat}} - a framebuffer screenshot grabber
 
* {{AUR|fbcat}} - a framebuffer screenshot grabber
Line 162: Line 130:
 
* {{Pkg|fbv}} - an image viewer
 
* {{Pkg|fbv}} - an image viewer
 
* [[screen]] - a terminal multiplexer
 
* [[screen]] - a terminal multiplexer
 +
* {{Pkg|w3m}} - a commandline web browser
  
 
==External Links==
 
==External Links==
 
* [https://bbs.archlinux.org/viewtopic.php?pid=1019748 fbpdf, fbpad, and fbff - A Minimal Framebuffer Software Suite]
 
* [https://bbs.archlinux.org/viewtopic.php?pid=1019748 fbpdf, fbpad, and fbff - A Minimal Framebuffer Software Suite]
 
* [http://litcave.rudi.ir litcave], the homepage of Ali Gholami Rudi's software projects
 
* [http://litcave.rudi.ir litcave], the homepage of Ali Gholami Rudi's software projects

Revision as of 11:04, 1 September 2013

Template:Article summary start Template:Article summary text Template:Article summary end

fbpad is a small framebuffer terminal that manages many terminals through single character tags. It is exceptionally lightweight, being written in C and using its own font format, tinyfont, which avoids xorg font dependencies. fbpad optionally supports 256 colors, bold fonts, and saving the framebuffer contents to memory, all which combined make fbpad a viable alternative to the X server for many purposes.

Installation

fbpad-gitAUR can be installed from the AUR, which by default imports the "bold" and "scrsnap" branches of fbpad, which add in 256-colors and bold fonts, and saving the contents of the framebuffer, respectively. fbpad is customized via a config.h file, and edits to the config.h file are incorporated into fbpad after recompiling fbpad, using the command makepkg --skipinteg -i.

Configuration

Users most likely will want to edit the definitions in the config.h for fonts (more on this later), SHELL, MAIL, and EDITOR prior to use, to their preferred programs.

dwm users should have no problems accustoming to fbpad. fbpad-specific keybindings are initiated with the modifier key, which is hardcoded as the Alt key, just like in dwm. Alt+j and Alt+k switch between terminals in an open tag, Alt+o switches to the last open tag, and Alt+p shows the list of open tags, to name a few. Users comfortable with manually patching source code can edit the fbpad.c file to edit/add keybindings.

If you re-compile fbpad often, you would probably like to be able to reload fbpad without having to manually re-launch it. The following code starts fbpad post login in tty1 and will reload it if you quit fbpad with Ctrl+Alt+q.

if [[ $(tty) = /dev/tty1 ]]; then
  while true; do
    fbpad >/dev/null 2>&1
  done
fi

Place this at the end of your shellrc file.

Tag Colors

The default background of the list of tags is hardcoded as white, the foreground of empty tags as black, the foreground of fully occupied tags as green (each tag may contain two terminals), and the foreground of tags that are not fully occupied as blue. This color scheme clearly is not for everyone, but this is easily remedied with the following patch:

--- a/fbpad.c	2011-11-11 13:02:22.834825518 -0500
+++ b/fbpad.c	2011-11-11 13:04:07.016043271 -0500
@@ -110,7 +110,7 @@
 
 static void showtags(void)
 {
-	int colors[] = {15, 4, 2};
+	int colors[] = {8, 2, 9};
 	int c = 0;
 	int r = pad_rows() - 1;
 	int i;
@@ -128,7 +128,7 @@
 			nt++;
 		pad_put(i == ctag ? '(' : ' ', r, c++, FGCOLOR, BGCOLOR);
 		if (TERMSNAP(i))
-			pad_put(tags[i], r, c++, !nt ? BGCOLOR : colors[nt], 15);
+			pad_put(tags[i], r, c++, !nt ? 8 : colors[nt], BGCOLOR);
 		else
 			pad_put(tags[i], r, c++, colors[nt], BGCOLOR);
 		pad_put(i == ctag ? ')' : ' ', r, c++, FGCOLOR, BGCOLOR);

To use, replace "8" with the desired color for empty tags (in both instances), "2" with the desired color for not fully occupied tags, and "9" with the desired color for fully occupied tags, where the colors 0-15 are defined in the config.h file. This patch also makes the default background color the background color of your terminal, which the writer finds to be a more natural choice.

Note that the second "8" is the color for tags for which fbpad saves the framebuffer contents. If you choose to define TAGS_SAVED as TAGS, then you will want your default foreground color and the color for saved tags to be the same, i.e. "8" in both instances. Otherwise, you may define TAGS_SAVED as a concatenated string of the tags to be saved, and change the second "8" to the color you wish to indicate saved tags by. The writer herself saves all tags for convenience.

Save the patch as fbpad-tagcolor.diff, add 'fbpad-tagcolor.diff' to your source array, and the following line to the PKGBUILD after the line that copies the config.h file:

patch -p1 -i "${srcdir}/${_gitname}-tagcolor.diff" || return 1

Fonts

The font format for fbpad is the "tinyfont", and there exists a utility, ft2tfAUR, which converts TTF files to the tinyfont format. You will need to edit the config.h file in the ft2tf build directory to point to the TTF file of your desired font. For instance, if the font file MonteCarloFixed.ttf was located in $HOME/.fonts directory, you would edit line 10 of the config.h to look like the following:

{"/home/archie/.fonts/MonteCarloFixed12.ttf", 6},

if your username was "archie", and the font size of Monte Carlo you wished to create was size 6. Delete other font lines you see other than this one, unless you wish to supplement your font with the glyphs from another font, in which case, add lines like the one above for your other TTF fonts.

Then, run makepkg -skipinteg -i to rebuild and reinstall the package with your customized settings.

After installing ft2tf, the following command creates a tinyfont file:

$ ft2tf > MyFont.tf

where "MyFont" can be replaced with a name of your choosing.

Remember to edit your config.h to point to the directory where you save your MyFont.tf. If your font also has a bold face, repeat the process of editing the ft2tf config.h file, this time specifying the location of the boldface TTF file in the ft2tf config.h, rebuilding with makepkg, and adding the final boldface tinyfont location to your fbpad config.h.

Also note that some fonts might require modification of the WIDTHDIFF and HEIGHTDIFF to have the proper width and height, respectively.

Color Support

By default, the AUR package installs the custom terminfo for fbpad, but you will need to add
export TERM=fbpad-256
to your shellrc to take advantage of the 256 color support. Clearly, commands not spawned in your default shell (for instance, those for EDITOR and MAIL) will not read your shellrc file, so you will need to edit their definitions in your config.h file to have the commands for EDITOR and MAIL run in a parent shell. For instance, the author of this article, who uses zsh, changed the default command for MAIL from:
#define MAIL		"mailx"

to

#define MAIL		"zsh -i -c mailx"

Additionally, to have colors with the ls command, "fbpad-256" needs to be added to the list of terms that ls knows can handle color. Per the README, run the following command in your shell:

$ dircolors --print-database | sed '/^TERM linux$/aTERM fbpad-256' >$HOME/.dircolors

and add eval `dircolors ~/.dircolors` to your shellrc file so that the custom dircolors file, with the fbpad-256 term added, may be loaded.

Usage

The following are examples of how some general desktop needs may be implemented in fbpad.

Copying Text

As everything is done mouselessly in fbpad, to copy text, users can make a "screenshot" of all the text on the screen with the Alt+s command. This will save all viewable text to the file /tmp/scr. Then, if your shell supports editing the commandline with vim (for instance, the edit-command-line ZLE function in zsh), you can open the /tmp/scr file as a new buffer in vim and use its copy keybindings to paste the needed text into your original buffer. Emacs users probably can adopt a similar scheme to copy text.

Watching YouTube

If one is using MPlayer with the video output driver set to fbdev2, youtube-viewerAUR can be used for searching YouTube and watching with MPlayer from the commandline in fbpad. Alternatively, one can add the following script as an external browser in the commandline web browser w3m, and launch playback of videos from YouTube websites with one's media player of choice. The script below employs fbff-gitAUR, a lightweight media player also written by the author of fbpad, and yturlAUR, a simple program, that, rather UNIX-like, functions solely to convert YouTube URLs into directly watchable URLs.

#!/bin/sh
video=$(yturl $1)
fbff -f $video > /dev/null 2>&1

Save the file in your PATH as youtube.sh, and add it as an external browser to w3m by opening w3m, hitting the o key to edit options, and edit the "External Browser" field under "External Program Settings" by entering in the field "youtube.sh". Hit "OK", and you are done. Now, when wishing to watch a video, with YouTube open, hit the M key, and the video will begin streaming instantly in fbff.

Recommended Programs

Here are a few recommendations for programs that enhance the usability of a framebuffer-based desktop:

  • dvtm - a dynamic virtual terminal manager (think dwm, but for the console)
  • fbcatAUR - a framebuffer screenshot grabber
  • fbff-gitAUR - an ffmpeg-based media player
  • fbpdf-gitAUR - a MuPDF-based PDF viewer, optionally supports DjVu or rendering via poppler
  • fbv - an image viewer
  • screen - a terminal multiplexer
  • w3m - a commandline web browser

External Links