how to view web images from a console browser by jtr · command line computing - 19 January 2005, 16:12

I have been thinking about the best way to chronicle my experiment in living la vida console. I realized this morning that it mostly will be a series of reviews of applications since applications are the real tool in computing. Not to sound like a certain dancing monkey boy but it really is about applications, applications, applications, applications, applications, applications, applications, applications, applications. (Can one ever really pass up the opportunity to link to that gem?)

I am using elinks for my console web browser. I chose elinks because it seemed the best of the three options. The other two were links and lynx. I wish I had a sound, scientific reason for choosing elinks over these two, but I simply installed each, went to http://www.google.com and selected the browser that was most appealing. According to the links site, elinks is still in heavy development whereas links is not.

As I have blogged before, I am using my console in framebuffer mode. This is necessary to view images from the console. The default elinks configuration does not include support for viewing images. This is likely because framebuffer usage is not universal. Here is my short HOWTO for using the framebuffer in Linux.

First, make sure your kernel is compiled to support framebuffer devices. If you are using your distribution’s stock kernel, it probably has this support already. If you are not, you may need to recompile. Remember, Google is your friend. Search for “enable framebuffer linux kernel” and I am quite sure you will find the options necessary. After installing this you need to edit your boot loader. In /boot/grub/menu.1st (if you are using lilo, why? grub is vastly superior.), add this to the end of your kernel parameter (the one that specifies the kernel to boot):

video=vesa:ywrap,mtrr vga=0×318

This will produce a 1024×768x32 framebuffer. If your video card has insufficient memory for that color depth, you may need to try various vga parameters. If your system hangs with a message about the kernel referencing some memory something something, this is probably the reason. See here for more information. After booting, you should have a nice framebuffer console. You will notice the difference immediately. If you are using grub for a bootloader and if your system hangs with the above options, fear not! Grub is configurable on the fly! At the grub menu, simply press ‘e’ for edit and then select the kernel boot line and press ‘e’ again and try a different combination. If you are using your only net-connected pc, delete everything from “video” to the end of the line. Your system will boot without a framebuffer. If you are using LILO, again, why?

Tto get elinks to display graphics to your beautiful framebuffer console, you need to have fbi installed as elinks will pass the display of the image to it. Edit /etc/elinks/elinks.conf (in Debian; if you run another distro – why? – it may be /etc/elinks.conf) and add the following lines:

set mime.extension.jpg = “image/jpeg”
set mime.extension.png = “image/png”
set mime.extension.gif = “image/gif”
set mime.handler.image_viewer.unix.program = “fbi %”
set mime.type.image.jpeg = “image_viewer”
set mime.type.image.png = “image_viewer”
set mime.type.image.gif = “image_viewer”

Now start elinks, browse to a web page with images, and click on the “IMG” tag. A dialog box will appear. Select “Open” rather than “View” and elinks will call fbi and display the image. Yes, I did mention “clicking” on a link. With gpm running, elinks functions much like a gui-web browser.

I will post some screenshots tonight.

* * *

  1. Both links and elinks render websites in a FAR superior manner to lynx. They handle tables for one thing, and have SOME css support.

    Lilo? It works, it’s easy, and it’s not a huge pain in the butt like GRUB. :)
    Topher    Jan 19, 04:47 PM    #
  2. Framebuffers are for wimps! Real men tweak their console up to a billion characters by a million characters, so they have to read text with a jeweler’s loupe (unless they’re Topher), and then they use aalib-enabled applications to view images. Mplayer can use aalib! You can watch video without ever leaving text mode! To say nothing of quake…
    Ed Heil    Jan 19, 04:49 PM    #
  3. LILO? Dude, mess up LILO’s config, reboot, and see what happens! Your system is a boat anchor (unless, of course, you have a KNOPPIX cd handy and know a bit about chroot, etc.) Bah. Grub is better. One could even boot with grub if grub’s config file is empty since grub is able to interact with the filesystem (ie, one can check out the filesystem to find the kernel file to boot). LILO. Feh.

    Heh. The funny thing about Topher’s 8000000×70000000 display resolution is it is rarely taken up by applications. Every time I have seen his desktop, it has been mostly that – desktop. He has all the screen real estate in the world to show half a wallpaper image. :-)

    Mplayer can use aalib? (Heh…why? Actually, why not?) Hmm… Since I am living la vida ascetic, perhaps I should look into that… Ballmer dancing about on stage in techni color ASCII. Ah well, another late night. :-)
    jtr    Jan 19, 05:04 PM    #
  4. Mess up Lilo’s config and reboot to recovery mode and fix it. Piece of cake. I’ve never even seen docs on how to edit Grub’s config.

    You rarely see apps on my shots because I like to show off my wallpapers. :) It’s usually filled with a browser and a couple terms and a gaim window.
    Topher    Jan 20, 08:40 AM    #
  5. You don’t see docs on grub cause they aren’t as needed. :-) Much easier to config and forgiving of mistakes.
    Josiah Ritchie    Jan 20, 10:35 AM    #
  6. Well J-T, some of your experience could not be duplicated entirely on FreeBSD, since (I am told) the framebuffer is scarecely developed there. I have a humorous manpage on ‘fbdevhw’ that mentions Linux, but nothing about implementation of FreeBSD. However, extended VESA mode isn’t that hard, requiring only a kernel recompile; it’s not in by default.
    Ed Hurst    Jan 20, 11:59 AM    #
  7. GRUB is easy to configure? The first time I ever tried it, it was on a dual boot machine. It didn’t find windows, and since there was no way to edit the config, and the distro didn’t have lilo available, I had to reinstall Linux to get Lilo. That’s dumb.
    Topher    Jan 20, 12:11 PM    #
  8. Yeah, grub is simple to configure. On my Debian boxen, I can compile kernels the Debian way which creates a .deb. ‘dpkg -i my_new_kernel.deb’ will install the kernel, modules, and update grub with an addition boot option for the new kernel. It also creates a second additional boot option for single-user mode with the new kernel.

    Having to reinstall Linux to get LILO is dumb. You should not have to do that.

    On this machine (the one I am using for the experiment) the Debian installer found the Win95 partition and correctly/automagically configured grub for it.

    BTW, configuring grub is as easy as ‘vi /boot/grub/menu.1st’.
    jtr    Jan 20, 01:36 PM    #
  9. Ironically, Debian has been the hardest system to compile a kernel on that I’ve ever worked with. I’ve tried probably a half dozen times, and it never works.

    I guess one of the reasons I like lilo so much is that it just works, and it’s simple.
    Topher    Jan 23, 01:22 PM    #
  10. It is funny (as in odd) how we have such different experiences with Debian. I have used Slackware, RedHat, SuSE, Debian, and a couple other derivatives of these and I have found Debian’s kernel compilation/installation to be the easiest and the smoothest. I suspect LILO is simple for you because you know it. As “they” say, every interface is intuitive once you know it.

    BTW, LILO “just works” – unless you forget to run lilo before rebooting. :-)
    jtr    Jan 24, 12:08 PM    #