Fork me on GitHub

Prepare for a day without X

Some time ago I started to look more in the TTY and how can I be productive, without having a fancy Desktop environment. So Today was the last missing peace in the puzzle - A browser with graphics and mouse without Xserver. But let's see what are all the other preparations to come to this last cool feature.

The cyrilic terminal

I write often in cyrillic (you know - Bulgarians always do), so First thing to do was to make keyboard layout switching between English (USA) and Bulgarian (Phonetic) keyboards. This is easily done with the cyr program. To install it in Ubuntu you need the package console-cyrillic - just:

sudo apt-get install console-cyrillic
# To configure it:
cyr bg_phon alt_shift_toggle --encoding=utf-8 --save

That's all to change your keyboard layout from EN to BG with Alt+Shift keys.

More then one program in TTY

To use more then one application in a single TTY and to have the ability to switch between them you will need screen. Ubuntu provides a cool modification called byobu. Just start it and then you can create as many screens as your want with the key-combo Ctrl+a+c and ofcourse switch between them with Ctrl+a+n (for next), or Ctrl+a+p (for previous) or just Ctrl+a+# (where # is the number of the screen).

You emails in one application

This was the hint from my university (FH Cologne). There we used the AIX Unix system, and the mail client there was called pine, but the more up-to-date branch of this easy to use terminal application in the Linux world is called alpine. In difference to other such programs like mutt - alpine is very easy to use, and provides a lot of configuration options. On the Internet are lot's of tutorials how to setup alpine to use gmail so I will skip that part.

Connect with other people

Emailing is probably the best option to stay in contact with your friends and colages while using the TTY, but sometimes for a fast help or just relax for a couple of minutes with a nice conversation then there are irssi for (IRC Networks) and finch (the ncurses based version of Pidgin - MSN/Jabber/Google/ICQ etc.). You just need to install them and configure, but that's really the easy part. For people coming from the windowed-desktop can be very hard to get used to the keyboard for everything. Nobody can help you here, just start practicing - you will find it handy in no time.

Rock'n'roll that terminal

Music is not only for relaxing, it's part of everything, so we have to be able to listen some of our mp3s/wavs and so on. Here are 2 solutions that I find perfect. The one is mocp - provides a music server and client in one. This gives you the power to listen music even switching between TTYs. Mocp plays the music in the backend. The other cool player is cmus an easy to use console music player, with some cool features like replay-gain. The only problem is that your should compile it from sources if you use Ubuntu 10.04 like me. But if you are going to use the TTY for a whole day, it shouldn't be a big problem just a bit more of apt-cache searches and ''./configure''s :).

Videos in the framebuffer

So after finishing work a nice movie would be great. Here comes the powerful mplayer. Yeah mplayer is everywhere! Here is a little bit tricky, but it's not impossible. First you need to configure your framebuffer:

sudo apt-get install fbset

With the fbset tool you do it automaticly. Just running fbset (as root) with start it Next thing is opening the movie with mplayer. I made myself a simple bash script for this:

# First parameter is the movie
# Second optional is the subtitles encoding
# Third optional is the video size for the fullscreen
mplayer -vo fbdev $1 -fs -subcp ${2:-cp1251} -vf scale=${3:-1280:720}

The webbrowser with graphics

At least the browser. The answer is links2 and the package gpm. The gpm tool enables for you the using of the mouse in the framebuffer. To configure your mouse in TTY:

# for USB mouse
gpm -m /dev/input/mice -m imps2

And then the magic for starting links2 is with the option ''-driver'' like so:

links2 -driver fb

Well that's it. I will not cover the text editing etc. It's just Vim. and nothing more. And some self-made scripts one of them based on the awesome library for python fabulous for color output in the terminal and a neat feature to trace PNG images and display them:

#!/usr/bin/env python
from fabulous import image
print image.Image('/path/to/your/image.png')

That's all.

Comments !