Life on the Console: Debian Squeeze

Perhaps you can come up with your own reasons for it, but running Linux on the console only is certainly worth the effort. For example, a lot of really fine hardware still runs fine, but painfully slow if you run any recent version of the X-server. In my case, it’s simply a matter of comfort and sanity. No one has to tell me I’m way out on the fringe of things, but I really don’t care for the way X and window managers work. I could say that about most GUIs I’ve tried on other operating systems, but that’s surely due in part to my use solely of DOS during my first five years of computer experience. While I hated the limitations of the 80×25 screen, everything else about it was quite comfortable for me from the user perspective. If the number of discussions on Usenet and various forums are any indication, I’m not alone in wishing more was offered for the Linux console.

Over the years, I’ve been keeping an eye on this, and tested the possibilities from time to time. That includes forays into BSD Land, but the framebuffer is very unpopular there. Regardless of what’s possible, what I need for my own use isn’t available without the framebuffer. A key element of promoting Open Source is freedom of choice. It has nothing to do with any inherent superiority from where I sit, but how closely it matches what I need. While specific needs do change, there has been an underlying collection of things I have wished for over the years. Recently, things have come together, and gotten my attention, and I’ve made the move.

For my purposes, this means running Debian Testing (“Squeeze”) on my Dell Inspiron 4100. Relevant specs are:

  • 1Ghz P3
  • Radeon M6 w/32MB VRAM
  • half-GB RAM
  • 20GB hard drive, DVD/CDR

You can find the official Debian installation guide here. Having tested a few of the daily build ISOs for Squeeze, I found I couldn’t get one that worked consistently, so I opted for installing Lenny and running an upgrade. In essence, it meant catching TaskSel, un-checking the “Desktop” option, and keeping the Base System and Laptop. Once the system was up and running, I used Nano to change all the references in my /etc/apt/sources.list from “lenny” to “squeeze”. I also had to take out references to the Volatile Repository. Then I ran apt-get update and apt-get dist-upgrade. Once that was working, I added the “contrib” and “non-free” plus the Debian-Multimedia repository and ran apt-get update and apt-get upgrade.

By no means do I claim to be a geek. I’m not even a geek journalist, just a writer with a geeky bent. I’m much better with people than with computers, so my primary computer-related work has been helping ordinary people get along with their computers. For me, computers exist to serve people’s needs, and are otherwise not very important. I frequently advise people, if they can live without a computer, not to get one. Most of my computer use time is in research and writing. Most of what I write is about religion and social sciences, and only a little about computers and other technology. So I tend to learn only so much as I know I’ll use, and secondarily about things I find it useful to teach others. You need not be a genuine computer geek to make use of what follows.

One of the first things is getting the console set up. For my laptop, the native resolution is 1400×1050. To get all of that, I had to edit my /boot/grub/menu.lst at the line which begins with # defoptions and add vga=834. Then, I added the console-setup package, which pulled in the marvelous Terminus console font. Once installed, you’ll need to run this command:

dpkg-reconfigure console-setup

Accept the defaults, keep the UTF-8 encoding, but choose Terminus as the font, using size 16. Reboot and everything should be nice, with sharply defined text filling the screen out to the edges. I also personalize my login prompts. For my user account, I like cyan and yellow, with some indicator of where I am in the file system. You can learn more about that here. Here is what I have posted at the bottom of my ~/.bashrc:

export PS1="\[33[0;36m\]\u@\h\[33[0m\]\w\[33[1;33m\]>\[33[0m\] "

Next, be sure you install GPM (apt-get install gpm) if you intend to use the mouse at all on the console. Apt will set it up for you automatically. If you are using only a two-button mouse/touchpad, you’ll need to run dpkg-reconfigure gpm, accepting all the defaults on each page, but on the last option type in “-2” so you can use your right-click to paste.

A primary activity is web browsing. I typically use these three for different purposes: Elinks, Links2 and Lynx-Current. Installing Lynx and Links2 as-is works fine for my needs: apt-get install lynx-cur links2 (accept the proposed dependencies by hitting “y”). However, I don’t care for the Debian defaults in Elinks, and the latest unstable release is actually significantly better. So after fetching the source for the unstable pre-release, I waded through the various standard dependencies (listed here) to see what I really needed. For example, I have no use for Lua, FSP, IDN, and a few others. However, I understand all too well about Spidermonkey, because way too many sites I use require a certain minimum of JScript, and Elinks is the only browser I’ve tried which implements the minimum. Even then, I’m locked out of a few places I don’t really have to use, such as Yahoo Mail. Aside from the “build-essential” package, I prefer OpenSSL over TLS (libssl-dev), and really wanted the mouse to work (libgpm-dev), and added in zlib1g-dev, libbz2-dev, libexpat1-dev, libkrb5-dev, along with whatever dependencies these brought. I configured it with this line:

./configure --enable-cgi --enable-gopher --enable-exmode --enable-html-highlight

When running Elinks, I typically prefer to select the black background as default (Setup > Options manager > Document > Default color settings > Background color = black, and Default color settings > Use document-specified colors = 1). The trick came in blogging. This applies to Blogger, WordPress and MyOpera. In Elinks, each of them is generally usable with varying levels of difficulty, but once you get past orienting yourself to the odd display, you find yourself using a pretty small block for text entry. Because the latest Elinks allows opening an external editor in all the tabs, I had to hunt down an editor which allowed soft-wrapping on the console. To my knowledge, only Vim does this right. The default method of passing off to an external editor is entering the text box, hitting enter to activate it, then hitting F4. I configured Elinks to use Vim by default (Options manager > Document > Browsing > Forms > External editor = vim).

Since I don’t write code, I really have no other use for Vim. I’m task oriented, learning only what I know I’ll use. I use it only for typing soft-wrapped text in the places where Elinks offers a text input. That I can have spell check on-the-fly is a bouns. So my .vimrc has two lines, so far:

set spell
set wrap linebreak textwidth=0

This, of course, requires you boost the default installed vim-tiny by apt-get install vim-nox. Otherwise, the spell check won’t work, and the soft-wrap will break in the middle of words. The other trick is being patient with the odd cursor movements which come with soft-wrap, since each “paragraph” is treated as a single line, but with a visual-only wrapping. Of course, you can always use this Vim setup to write your longer posts beforehand, then when you get to that part of your blogging and hit F4, you can tell Vim to pull in that prepared file by, first typing :r /path/to/file and then hit ENTER. After that, you can have the file inserted in the text box by saving and closing Vim (:wq).

Another primary activity is email. I have five accounts I can use with any regular mail client. Mutt is almost as bad as Vim for complexity and learning curve. My old favorite Pine has now become Alpine, and it’s capable of running multiple account, all with POP and SMTP actions. However, it requires a little extra work in the setup procedure. It would be hard for me to write up any better than this excellent guide (gone; see this instead). However, Debian’s build of Alpine blocks the saving of passwords. Carp all you want about security, but after reading the explanation, I’m satisfied it’s secure enough to suit my needs. So I rebuilt it from source.

This time, instead of plowing through the list of dependencies, I simply ran apt-get build-dep alpine. When I tried that with Elinks, I got a ton of dependencies calling for major chunks of the X server system. For Alpine, that didn’t happen. So once I got the build dependencies, I pulled down the source package and built it manually. My configure statement looked like this:

./configure --with-local-password-cache-method --with-passfile=.alpinepwd

To get Alpine to save my passwords, I had to create the file first: touch ~/.alpinepwd. The only other item I recommend is Alpine users check out the color highlighting options (Setup > Kolor). On the console, you should stick with the “use-termdef” selection at the top of the form, since I know of no way to get the console to recognize 16 colors.

For most of my standard text editor activity, I use Joe. This permits me to create text files with all the formatting features I need for plain text. For HTML files, the syntax highlighting is very useful. I can report installing Mplayer without X (apt-get install mplayer-nogui) and the codecs package will allow watching videos on the console. I tested a MS-WAV file with “-vo fbdev” and it worked just fine. Sound will work if you fix a bug in the setup script. Sound and video aren’t really significant in my use, but I wanted to work it out for this article.

Finally, there are a couple of things I still wish to see in the future: a console word processor and a full-featured console browser. While the folks at Elinks are doing marvelous work, I have to wonder if there isn’t some way Firefox, WebKit, or one of their lighter versions can’t be ported to a console toolkit. I could care less if there is any hint of graphical rendering, as with Links2, or even pseudo-graphics (say libcaca), but the full range of JScript and so forth would really make a difference. Making it equally mouse-able on the console would be a major plus.

The word processor idea presents the paradox of having hundreds of supporters but no developers. I can’t count how often I’ve read or heard someone wishing for it, but nary a word from anyone among Open Source developers. I realize it’s quite a grand undertaking. However, even something like a clone of Lyx or TeXmacs would be a huge achievement. I’m guessing a major hold up is how to implement printing. For myself, even your basic character-based output would be enough for most purposes. I have no idea what’s involved in linking something like CUPS with a console-TUI word processor. However, anything at all would be much celebrated, even if only by a relatively small group. But if anyone wants a coordinator, PR and documentation writer, I’ll volunteer for those parts. I know for certain I can get the hosting for free. Why there seems to be not a single developer interested is something I can’t answer.

Welcome to the console. Unless things change dramatically, I’m here to stay.

This entry was posted in computers. Bookmark the permalink.

11 Responses to Life on the Console: Debian Squeeze

  1. Francis says:

    I share your enthousiasm for the console, it promotes single tasking. Another nice and clean option might be a low memory tiling window manager with x, windows maximize to available screen space so no desktop is visible.
    Awesome is one of them, dwm another.
    http://awesome.naquadah.org/images/screen.png

  2. LM says:

    Nice to run into other people who enjoy working from a command line or in console mode. Thanks for the mplayer tips. Look forward to trying it out. Some console enthusiasts have mentioned Wordgrinder at Sourceforge as a good word processor. I use SciTe (needs GTK 2) for most of my word processing and have it call out to other applications as needed. Same technique should work with any good programming editor (including console mode ones). If you know HTML and CSS, you can create your documents in that format and convert to Postscript or PDF using tools like wkhtmltopdf or html2ps. It may be an easier option than Latex. Agree with your comments on console mode browsers and Javascript. Would be nice to find one with decent Javascript support. v8cgi works nicely from the command line for running Javascript code, but it’s not integrated with any browsers. Still looking for a console mode browser that can display output of diffh in a readable format too.

  3. zenny says:

    I recommend i3-wm for the tiling manager with dmenu and geany + nano for text editor which I am using after testing all tiling managers and text editors. I am using links2 + firefox for browser. I use evilvte for terminal, extra lightweight. Worker for file management with xli, wonderful combination!!!

    zenny

  4. bigato says:

    Hi,
    Try latex with vim, enabling syntax highliting, and you’ll know why
    there is no wordprocessor for the console. It’s a lot easier than
    learn and/or write html. Look for a good simple introduction. As a
    writer, you sure will love it. Congratulations on your article.

    • Ed Hurst says:

      I have looked at Latex. Jokingly I suggest you must be out of your mind to say it’s easier than HTML. I write HTML on the fly; I don’t have enough years left to learn Latex. Nor do I have any reason whatsoever for doing that, since I rarely need to produce anything on paper. That’s why we use word processors, because we don’t have time to worry about what it does under the easy interface. We all specialize, and we find what we do best. Composing documents in Latex is simply of no importance to me. I’m sure it’s pretty important to others, and I hope to God it never goes away, but I have no use whatsoever for learning it.

  5. ke na says:

    Hi,

    instead of LaTeX, I would suggest you spend five minutes of your time looking at reStructured Text: http://docutils.sourceforge.net/

    This is a text-only format where spacing and other (intuitive ASCII characters structures your document. Then you can automatically convert your RST document to HTML, TeX, S5 (presentations) and others. I use this almost exclusively for all my writing (technical documentation and project management).

  6. Pingback: Quirk the Internet « Do What's Right

  7. Jaime Lopez says:

    txt2tags is another option to convert text plain files to diferents kinds of format.

    Great post. I liked it a lot.

  8. Pingback: Personal Computing in the Apocalypse « Do What's Right

Comments are closed.