• Tip Jar

TTYtter, an Awesome Console Based Twitter Client

TTYtter is a great command line Twitter client. To get it up and running to its optimal capabilities can take a little work, especially if you would like to get pop up notifications on your desktop with libnotify. So, here is a guide that will show you how to get it all working. Even if you are normally a GUI only sort of person I would still like to suggest you give it a try. TTYtter is my favorite Twitter client. These instructions work on Ubuntu 9.10 Karmic and later and should work on other systems with minimal modification.
If you are a Vinux user, or if you have added the Vinux PPA, you can install TTYtter by opening terminal and typing:
sudo apt-get update
sudo apt-get install ttytter
To install TTYtter manually with readline support and get the curl package open terminal and type:
sudo apt-get install libterm-readline-gnu-perl curl
Arch Linux users also need the perl-term-readkey package:
pacman -S perl-term-readkey
If you use the readline package above you will need to set your PERL_RL variable. To do this open terminal and type:
gedit .bashrc
When the file opens add the following line to the end:
export PERL_RL=Gnu
Save the file and reload it by typing:
source .bashrc
In 1.1.6 and later, you can install a TTYtter specific readline called Term::ReadLine::TTYtter. To do this, go to CPan and download the package. Extract and install the package by opening terminal and typing:
tar xzvf Downloads/Term-ReadLine-TTYtter-1.2.tar.gz
cd TTYtterReadLine/
perl Makefile.PL
sudo make install
Note that the number in the .tar.gz file will change as newer versions are released.
Now, to download TTYtter:
sudo wget -O /usr/bin/ttytter http://www.floodgap.com/software/ttytter/ttytter.txt
sudo chmod 755 /usr/bin/ttytter
If you do not have system wide access save it to ~/bin/ttytter instead of /usr/bin/ttytter and use chmod 700 instead of 755. It may be necessary to create the ~/bin directory.
If you would like to get everything up and running as quickly as possible with extensions from several different authors, you can download the ttytter-extensions pack. Read this article for more infromation. If you install the extensions, you can visit the .ttytterrc generation page to create the .ttytterrc settings file in a few simple steps. When your .ttytterrc file has been placed you can then start the program by typing:
ttytter
in a terminal. For complete instructions on using TTYtter, commands, menu codes, etc please read the TTYtter home page.
If, however, you want to set everything up manually, read on. TTYtter is now installed but missing some of its coolness. If you were to launch it by typing:
ttytter
You would have to also include some arguments to get it going if you want to use things like readline. It’s much better to save this information in a ~/.ttytterrc file. So, here is the ultimate .ttytter file. If you do not plan to use the notifications with libnotify or libnotifyperl you can leave out the notification and exts lines. Copy and paste the following in to a file called .ttytterrc replace USER with the name of your home directory:
#TTYtter settings
#show replies in timeline
mentions=1
#Open images with Eye of Gnome
avatar=eog %U&
#Open URLs with Firefox
urlopen=firefox %U&
#let TTYtter decide how often to check for new tweets
pause=auto
#Use ANSI color
ansi=1
#Check version on start up
vcheck=1
#Number of retries to connect to Twitter
hold=15
#\r and \n create a new line
newline=1
#answer y or Y to post your tweet
verify=1
#use readline support. Change 1 to a list of followers in quotes for tab completion support
readline=1
#Enable word wrap
wrap=1
#Add the libnotifyperl extension
exts=/home/USER/libnotifyperl/libnotifyperl.pl
#Set notification service(s)
notifytype=libnotifyperl
#Set types of tweets for which you would like to receive notifications
notifies=dm,me,reply,search,default
#end TTYtter settings
The newest method of getting desktop notifications doesn’t require patching libnotify. You can still use that method if you would like, and the instructions are left for reference below this new method. The new way is to use an extension written by Colindean which does notifications using Gtk2::Notify. To get it:
sudo apt-get install git-core libgtk2-notify-perl
make sure you are in your home directory by typing:
cd
and then do:
git clone http://github.com/colindean/ttytter-libnotifyperl.git
The old way to enable notifications takes a little more work. The notify-send package is available from the repository, but for some reason a patch that
adds required functionality has not been added in to the distributed version. So, instead of using the standard package, we have to roll our own. If you are not sure if you already have it installed, in terminal type:
sudo apt-get remove libnotify-bin
To build the libnotify-bin package and apply the patch type the following in terminal:
cd
apt-get source libnotify-bin
sudo apt-get install gtk-doc-tools
sudo apt-get build-dep libnotify
then download this patch. You will probably need to right click the link and select "save link as". After the file has finished downloading:
cd libnotify-0.4.5/
The number in the directory name above may change as new versions are released. If you type libnotify and press tab it should complete the name, then press enter to get in to the directory. Then, apply the patch. My files save in ~/Downloads if your files download to another location you will need to alter the path in the next command to point to the downloaded file:
patch -p0 < ../Downloads/notify-send-support_body_from_file.patch
./autogen.sh
make
sudo make install
I had to restart before notifications worked as expected. Now TTYtter is installed and should work with its ultimate coolness factors enabled. Enjoy, but be warned, TTYtter will be your new favorite Twitter client after five minutes of use. For instructions check out http://www.floodgap.com/software/ttytter/.

Commanding the Command Line (Part 2)

This is part two of a discussion of accomplishing your hearts desire with out the use of a GUI. It’s back to the console for us as we dive in to such fun things as web browsing, instant messaging, and text editing.

Instant Messaging with Finch

Pidgin and Finch are closely connected. finch is the command line version of Pidgin. So, the way I handle setting up accounts is with Pidgin. Then, in the console launch by typing finch. The first time you run it you will be presented with the accounts list. Use highlight tracking in Speakup because it works better with Finch. Press space on each account you want activated. Move through them with the up and down arrow keys. When you activate an account it will say X to show that it is checked. When you have activated all of your accounts, press alt+a to be taken in to a menu with items like buddy list, plugins, sounds, etc. Select the sound option and tab until you find the first sound option, probably "Someone says your name in chat". Press space to check each item for which you would like to have sound. Use the up and down arrows to navigate the list. After selecting the sounds you want, press alt+a to get back to the menu. I must say that I have never successfully gotten sounds to work in Finch but I know people who have, so it’s just my problem apparently. Select Plugins and check the plugins you would like to activate. Most of the plugins that work in Pidgin also work in Finch. This is a good time to mention my favorite sets of plugins. Some of these only work with Pidgin, but I will include them anyway. Pidgin-musictracker displays your currently playing track in Pidgin. Pidgin-plugin-pack, lots and lots of useful plugins. Pidgin-mbpurple, adds Twitter and a couple of other things to Pidgin. To get them all:
sudo apt-get install pidgin-plugin-pack pidgin-musictracker pidgin-mbpurple
When you have the plugins configured the way you want them, press alt+a to get back to the menu. If you are not on your list of groups that contain your contacts, press tab until you get to it. Only buddies who are on-line will show up. To expand a group press space and to close it press space again on the group title. If you press f10 you will get another menu with things like add buddy in it. If you would like to turn off time stamps, while chatting with someone press f10 and press enter on show time stamps. To exit Finch press alt+q.

Web Browsing with Elinks

To get elinks, in Ubuntu, type:
sudo apt-get install elinks
When you first install Elinks, it takes some configuring to get it working optimally with Speakup or any other console screen reader. To launch it type:
elinks
If it is the first time you will get a welcome message. Press enter to go to the next screen. Here it will ask for a URL. Press escape to get into its menus. In Speakup, it is a good idea to turn on highlight tracking if you haven’t already. Press right arrow to get to the Setup menu, then down to Options Manager and press space to activate it

Numbered Links

Move down to Document and press space to activate it then down to browsing and press space again. Go down to links and press space. Move down through the menu until you find Numbered Links and press tab until you get to Edit then press enter. For some reason these selections do not read exactly right. when I was on the Edit option, for example, it said "Info Edit". Press backspace to remove the 0 and type the number 1 in its place and press enter. Now links on pages will be numbered. To activate a numbered link type its number and press enter then enter again to activate it.

Turn Off Frames

Press down arrow until you get to Html Rendering and press space. Go down to Show Frames and tab to the Edit option and press enter. Change the 1 to 0 and press enter.

Remember to Save

When you have finished setting options, be sure to save. Tab until you get to the save option and press enter. In this case, Speakup read it as "Search Save". You will know you did it right if you get a message about the configuration being written successfully.

Tips and Tricks

You can launch elinks with an address so when it opens you will go directly to a web page instead of having to type in the address. for example:
elinks http://www.stormdragon.tk/
or:
elinks stormdragon.tk
To enter a new URL press g. If you would like to be able to copy the current URL, press shift G. You can use screen’s excellent copy feature to get the current address.

Email with Alpine

To get Alpine, in Ubuntu, type:
sudo apt-get install alpine
To launch Alpine type:
alpine
the first time it runs it will create a mail folder and show you a welcome message. Press enter to get to the main menu, then s for setup and c for configure. If you want to use Alpine with your gmail account, there is an excellent guide that shows you how. If you get imap errors when trying to retrieve your email, open the .pinerc file and search for the line that reads:
inbox-path={imap.gmail.com/ssl/user=YourEmailAddress@gmail.com}
Remove any extra characters after the right brace } and save the file. It should now work correctly. Alpine works very well with Speakup and the menus are clear and not difficult to follow.

Commanding the Command Line (Part 1)

In the event that you decide to, or for some reason have to go completely command line for a while, you will likely be wondering how to do certain things. There are some things that have to be done on any computer to make the computer in question worth it’s plastic. So, here is part one of a discussion on doing these important tasks from the command line. Some of this may be covered elsewhere here but I am including it again for the sake of completeness. To get to the console from gnome, press control+alt+f1 through f6. You have six consoles to choose from, but when you wanna go back to gnome, it is control+alt+f7. If you want to use the console you will need a screen reader for it like Speakup. For information on installing Speakup in Ubuntu read "Speakup Revisited".
If you are completely new to the command line, you can use these two tutorials to get started with it quickly:
Into the Linux Command Line Interface (CLI) and Introduction to Command Line Interface (CLI) 2.

Multiple Terminals With Screen

I am pretty sure that Ubuntu comes with screen installed. I don’t ever remember installing it, but it could have sneaked in as a dependency for something else though I doubt it. If you don’t have screen, you need it. To launch it, type screen. You will have to press enter after it starts to get your prompt back. Screen makes it so you can have several terminals all at once. To create a new one, press control+a followed by c. You can have as many as you want, one for music, one for email, one for instant messaging, etc. To switch between terminals, press control+a followed by n for the next one or p for the previous one. To close a terminal that you no longer need, type exit. Another great feature that screen has is the ability to copy and paste. When you need to copy something, press control+a followed by either the escape key or [. Use the arrow keys to position the cursor on the first of the text you would like to copy and press space. Find the last part you want to copy and position the cursor on it with the arrow keys and press space again. Now, when you need to past the copied information press control+a followed by the ] key.
The use of a ~/.screenrc file can help Orca users to copy from the terminal. Installing xclip is helpful for this. To get it:
sudo apt-get install xclip
Here is the .screenrc file that I use:
#Begin .screenrc
startup_message off
defscrollback 1024
bind b eval "writebuf" 'exec !!! xclip -selection "clipboard" -i /tmp/screen-exchange'
termcapinfo xterm|xterms|xs|rxvt ti@:te@
#end .screenrc
If you want to download this file, enter the following command in terminal:
wget -O ~/.screenrc http://stormdragon.tk/scripts/screenrc
Using this .screenrc file you can press control+a b after following the above instructions to copy text to place the copied text into the clipboard. If you are using screen in the console where the X clipboard is not available, you can still easily get the copied information from the file:
/tmp/screen-exchange
To move up and down through the terminal’s buffer press shift+pageup and shift+pagedown. This is slightly different from gnome-terminal with out screen in which you press control+shift+pageup and control+shift+pagedown to move through the buffer.

Twitter From The Command Line

The program twidge is an excellent command line Twitter client. A lot of distros include it in the repositories. In Ubuntu, for example, you can get it by typing in terminal:
sudo apt-get install twidge
If your distro doesn’t include it you can download it from http://software.complete.org/software/projects/show/twidge.
After installing Twidge, you need to configure it. To do this, type:
twidge setup
There are only two questions and they should be very easy to answer. After twidge is configured, you can get the latest tweets very easily. First though, you should run:
twidge lsrecent -su
This gets the last 20 tweets and also sets a place marker so you won’t see them or anything before them if you do not wish to do so. After running this command, you can then get all new tweets by typing:
twidge lsrecent -asu
To post an update type twidge update and press enter. Type your update and press enter again, just remember not to go over the 140 character limit. For more detailed instructions on Twidge and its uses, type:
man twidge
You may also be interested in TTYtter.

Weather Information

I wrote an article on weather a while ago. There is a great program called weather-util for the console. To find out how to install and configure it, please read "…And Weather For All".

Command Line Music Player

I have tried several terminal based music players. None of them worked well with Speakup. I was about to lose hope in ever finding a good one to use with a screen reader when I heard of cmus. In Ubuntu, get it by typing:
sudo apt-get install cmus
Launch it with the command:
cmus
and close by typing:
:quit
After the first time you start and close the music player open the ~/.cmus/autosave file. Find the line that reads:
set softvol=false
Change it to true and save the file. softvol allows you to change the music players volume without changing volume for the whole computer. There are a lot of other settings that can be changed in this file including repeat and shuffle. To add music to the library use :add and the directory where the music is stored. You can use :a as a short cut if you prefer. To add all of the songs in ~/Music and its sub directories, for example, you would type:
:a ~/Music
Use – to decrease the volume and = to turn it up. Previous track is z, play is x, pause is c, stop is v, and next track is b. Use the up and down arrows to move through the tracks in your library and enter to play the currently selected song.. For more info on cmus, type man cmus.

Sox, the Swiss Army Knife of Sound Processing Utilities

Sox is one of my favorite command line programs. It can play audio, record, convert from one file type to another, and add effects to audio. Unfortunately it is not packaged with all of its powerful abilities enabled by default. The best way to deal with this little problem is to download and install it yourself. The only thing it is lacking is the ability to write mp3 files. It can play them, but by default, in Ubuntu and I assume other distros, it can not write mp3 files. So, if you do not care about this functionality, just do the normal sudo apt-get install sox. If you want to be able to convert to mp3, you will need to download it from http://sourceforge.net/projects/sox/ and install it. Before installing though, you will need to get some other libraries. In Ubuntu type:
sudo apt-get install libmp3lame0 libmp3lame-dev libsox-fmt-all
sudo apt-get build-dep sox
Next extract the sox files with the following command. The version may have changed after this writing, so be sure to use the current numbers in the file name:
tar xzvf sox-14.3.0.tar.gz
Change to the newly created directory with:
cd sox-14.3.0/
./configure --with-lame
make
sudo make install
For more information on the options that can be used when compiling sox read the included INSTALL file.
Sox can do so many different things that it would take a long time to write them all down here. Here are a few things to get you started though:
sox filename.wav filename.ogg
Convert filename from a wav to an ogg file. Don’t worry, it doesn’t delete the wav file. You can convert from any type to any other type of audio.
play filename.ogg
Plays a file it can have effects added and the volume can be adjusted as well.
rec filename.ogg
Creates a file and starts recording to it. for all of the incredible things sox can do, type man sox.

  • Tip Jar