Twidge microblog client
Tweeting from the Terminal

The Twidge microblogging tool is easy to learn and provides a much less cluttered environment than Twitter.
You won't find Twidge [1] on a list of the top 25 microblog clients. Such lists rarely mention command-line tools – which is too bad, because Twidge is not just more powerful than desktop tools but also easier to use in many ways.
In the classic free software tradition, Twidge was written "to scratch an itch." Long-time Debian developer and Twidge's creator John Goerzen explains, "I was using Twitter, but frustrated at having to go online to see what was waiting for me." For Goerzen, other shortcomings of the Twitter web interface included "not being able to clear most tweets as read and save some for replying to later, and not being able to use it offline." Additionally, Goerzen wanted Twitter to have the potential to interact with email – specifically, Postfix and Exim – and shell scripts, which explains the combination of "Twitter" and "bridge" in the name.
Now at version 1.10, Twidge has accomplished all these goals and gained a small following among Debian and Ubuntu users, as well as other distributions, including Arch Linux. The reason for this modest popularity is not hard to understand: Twidge is easy to learn and provides a much more uncluttered environment for reading tweets than Twitter's own web interface.
Setting up Twidge
Before you can use Twidge, you need to configure it with the following command:
twidge setup
The command opens a text wizard to instruct you. The installer searches for the Gnome keyring but does not require it. If you are not running a Gnome environment, you will receive constant warning messages about gnome-keyring
not being found. However, you will still be able to use Twidge because the essential information to connect to Twitter is stored in .twidgerc
in your home directory.
After you copy and paste the link to Goerzen's website from the installer to your browser, you are taken to a page on which you can authorize Twitter to accept Twidge (Figure 1). Pressing the Authorize button gives you an authorization number to paste into the installer to complete the setup (Figure 2).
The installer creates the .twidgerc
file in your home directory. Because the file stores the authorization number in plain text, for the sake of security, you should limit its permissions so that only you can view it.
Reading and Writing Tweets
Like many commands that originated for Debian, Twidge uses both subcommands and options. A typical command structure looks like this:
twidge SUB-COMMAND OPTIONS ACCOUNT-NAME
A good place to start is with the command twidge lscommands
, which lists the available subcommands. Twidge assumes that you know the names on the accounts that you want to read, but if you don't, you will have to refer to the web interface because Twidge lacks a search mechanism.
You might also want to get in the habit of using -s
or --saveID
. This option notes the ID of the last message displayed, so if you use -u
or --unseen
the next time you check messages, only the unread ones are displayed.
To read the tweets sent since you last ran Twidge, you can combine the subcommand lsrecent
, which lists posts made by you or those you follow, with lsreplies
, which lists replies to your tweet. The first time you log in after any absence, the number of tweets is likely to be long, so you can pipe the two commands through less
so you can scroll back and forth easily:
(twidge lsrecent -su; twidge lsreplies -su) | less
Other commands for reading that you might use are lsdm
, which lists any direct messages to you, and lsrtreplies
, which lists retweets of your messages. Some of these commands, such as lsrtreplies
and lsdm
, are not supported in Identi.ca and will give you an error message if you use them.
If you prefer, you can add the -a
or --all
option to view all available tweets (Figure 3), rather than the top 20 or 100 specified by the microblogging site. To arrange information neatly in columns, you can add -l
or --long
(Figure 4). If you followed the instructions to set up email, -m **EMAIL
or --mailto=EMAIL
will route messages to the email client.
To write a tweet, use the subcommand update
, followed by your tweet in quotation marks:
twidge update "TWEET"
No status confirmation indicates that the tweet has been sent successfully. However, when a tweet exceeds Twitter's or Identi.ca's 140-character limit, Twidge's default behavior is to shorten any recognizable URL in the tweet. If a tweet is too long, Twidge fails to complete and does not send it. Twidge also includes the ability to send private tweets, which it calls direct messages. You can send a direct message with the command:
twidge dmsent ACCOUNT
Additionally, Twidge includes what might be called housekeeping subcommands. You can look back at tweets you have sent with the lsarchive
subcommand or your retweets with lsrtarchives
and your direct messages with lsdmarchives
.
Using block
or unblock
followed by an account name will control whether a particular user can reply to your tweets, although they will still be able to read them. Similarly, you can use follow
and unfollow
to set whether you receive tweets from a particular account. None of these subcommands returns a status message after running; however, blocking an already blocked account or following an already followed account will leave the command uncompleted.
Fine-Tuning Twidge
The .twidgerc
file in your home directory consists of a number of fields, some of which twidge updates as it runs and some of which can be edited manually; however, some should be left alone to be filled automatically. Most of the fields you should ignore will be in the [default]
section at the start of .twidgerc
, but do consult the Twidge documentation if you are uncertain which are which.
One field that you can edit freely is the savelast
field, which sets Twidge to always use the -s
or --saveID
option, so that only unread messages are displayed when you run a command. It works closely with the lastid
field, in which Twidge stores the ID of the last tweet that Twidge read.
You can also set up Twidge's URL-shortening functionality. Unless lsrecent
is specifically set to no
, the shortenurl
field sets Twidge to shorten all URLS with the help of TinyURL.com [2]. Alternatively, you can create a section of .twidgerc
containing your login name and password for using Bitly [3] as a URL shortener instead.
Another option is to create an [alias]
section of the file. This section includes one entry per line, in which the alias is followed by a colon and the full command. The alias section can be used to reduce the length of existing subcommands or to run multiple commands without typing them out in full. For example, instead of beginning a Twidge session with the combined command suggested previously with its options and pipe, you could instead just enter new
after adding the following line to .twidgerc
:
[alias] new: twidge lsrecent -su; twidge lsreplies -su) | less
Goerzen also supplies instructions for having Twidge send an email message when you receive a reply or for sending email as a tweet [4]. However, detailing these functions would require a separate article.
In theory, Twidge also can be set to use Identi.ca with a few edits of the [default]
section of .twidgerc
– aside, of course, from a few features that Identi.ca lacks. You can maintain the Identi.ca configuration file under a separate name and specify which configuration file to use with either the option -c FILE
or --config=File
. If you want to post simultaneously to all microbloggers, you can create a script with an instance of Twidge for both files. Alternatively, you might be able to activate simultaneous posting through a microblogger's web interface.
However, as I write, changes in Identi.ca appear to have made using Identi.ca with Twidge impossible in practice. Updated details of how to enable the use of Identi.ca may be available in the how-tos by the time you read this.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Direct Download
Read full article as PDF:
Price $2.95
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Find SysAdmin Jobs
News
-
Kubuntu Focus Announces XE Gen 2 Linux Laptop
Another Kubuntu-based laptop has arrived to be your next ultra-portable powerhouse with a Linux heart.
-
MNT Seeks Financial Backing for New Seven-Inch Linux Laptop
MNT Pocket Reform is a tiny laptop that is modular, upgradable, recyclable, reusable, and ships with Debian Linux.
-
Ubuntu Flatpak Remix Adds Flatpak Support Preinstalled
If you're looking for a version of Ubuntu that includes Flatpak support out of the box, there's one clear option.
-
Gnome 44 Release Candidate Now Available
The Gnome 44 release candidate has officially arrived and adds a few changes into the mix.
-
Flathub Vying to Become the Standard Linux App Store
If the Flathub team has any say in the matter, their product will become the default tool for installing Linux apps in 2023.
-
Debian 12 to Ship with KDE Plasma 5.27
The Debian development team has shifted to the latest version of KDE for their testing branch.
-
Planet Computers Launches ARM-based Linux Desktop PCs
The firm that originally released a line of mobile keyboards has taken a different direction and has developed a new line of out-of-the-box mini Linux desktop computers.
-
Ubuntu No Longer Shipping with Flatpak
In a move that probably won’t come as a shock to many, Ubuntu and all of its official spins will no longer ship with Flatpak installed.
-
openSUSE Leap 15.5 Beta Now Available
The final version of the Leap 15 series of openSUSE is available for beta testing and offers only new software versions.
-
Linux Kernel 6.2 Released with New Hardware Support
Find out what's new in the most recent release from Linus Torvalds and the Linux kernel team.