Thursday·23·April·2009
Screen and Emacsclient: Automatically switching to the Emacs window //at 18:41 //by abe
For a very long time, I use mutt with emacsclient as configured editor
and a single GNU Emacs instance started from either .screenrc or .Xsession, depending on the system. And I’m very used to
switching the virtual desktop or the screen window after starting a
mail in mutt.
Since Debian 5.0 Lenny and Emacs 22, Emacs automatically grabs the
focus and switches to the right virtual desktop. So after telling mutt
recipient and subject of a new e-mail, it invokes emacsclient and
immediately the focus has moved to the running Emacs instance. Because
I was used to switch one virtual desktop to the right at that point, I
often found my self two desktops to the right until I got used to it.
:-)
I usually hate applications which grab the focus without being asked. But in this case I basically asked for it. And there’s no delay like with starting up an application which has to read in some database first – think of Liferea or Rhythmbox which take many seconds to minutes to start up, even on my 2.2 GHz dual core ThinkPad.
In the meanwhile I got so used to that automatic desktop switch that I forget to switch the screen window in the second scenario where I use this combination: My screen doesn’t automatically switch to the Emacs window (window 1) after I told mutt recepient and subject in window 2.
Knowing that screen is quite scriptable, I found out that only a very
small change is needed to my mutt configuration to get that desktop
feature to my everyday screen session. I simply replaced the editor
setting in my .muttrc with the following
line:
set editor="screen -X select 1;emacsclient"
Now mutt tells screen to switch to window 1 (where Emacs is running) and then tells Emacs to open the appropriate file to edit my new mail.
Update Friday, 2009-04-24, 18:22
Even though Zack surely is right with his comment about the multi-terminal feature of the upcoming GNU Emacs 23, I still have Etch (and therefore GNU Emacs 21) on the server where I have my screen session.
So the next step was to switch back to the mutt window (window 2)
after I’m finished with editing the mail. Since mutt gives the the
file to edit as argument to the contents of $editor,
simply adding ;screen -X select 2 at the end of
$editor doesn’t suffice.
So I wrote a small shell script (named ~/.mutt/editor.sh) as wrapper which calls all the
commands and passes the parameters to the right command:
#!/bin/sh screen -X select 1 emacsclient -a ~/.mutt/alteditor.sh "$@" screen -X select 2
Of course, $editor is now set to that script:
set editor="/home/abe/.mutt/editor.sh"
Emacsclient of GNU Emacs 21 already supports the -a option to call
another editor in case of not being able to connect to a running Emacs
instance. Since I don’t want to switch to another screen window in
that case, I wrote a second shell script (named ~/.mutt/alteditor.sh) which switches back to the mutt window
and then calls GNU Zile, my preferred low-end emacs clone:
#!/bin/sh screen -X select 2 zile "$@" screen -X select 1
I love it!
Tagged as: $EDITOR, Debian, E-Mail, Emacs, Emacs21, Emacs22, Emacs23, emacsclient, Etch, GNU Screen, Lenny, mutt, screen, scripting, zile
1 comment // show without comments // write a comment //
Related stories
Wednesday·15·April·2009
Useless Statistics, the 2nd //at 18:05 //by abe
Myon recently posted a nice statistic about popular single letter package name prefixes. Just out of curiosity I started wondering about popular single letter package name suffixes:
On a machine with Debian oldstable, stable, testing, unstable and experimental in its sources.list, I ran the following command:
$ apt-cache search -n . | \
awk '{print $1}' | \
sed -e 's/.$//' | \
sort | \
uniq -c | \
sort -n
And to my surprise there is a non-obvious winner:
$ apt-cache search -n '^gp.$' gpa - GNU Privacy Assistant gpc - The GNU Pascal compiler gpe - The G Palmtop Environment (GPE) metapackage gpm - General Purpose Mouse interface gpp - a general-purpose preprocessor with customizable syntax gpr - GUI for lpr: print files and configure printer-specific options gps - Graphical Process Statistics using GTK+ gpt - G-Portugol is a portuguese structured programming language gpw - Trigraph Password Generator
But since I searched through the binary packages many other hits are more obvious, like the seven packages hbf-cns40-1 to hbf-cns40-7:
[...]
4 ar
4 aspell-f
4 automake1.
4 cpp-4.
4 e
4 g++-4.
4 gappletviewer-4.
4 gcc-4.
4 gcj-4.
4 gcompris-sound-e
4 gfortran-4.
4 gij-4.
4 go
4 gobjc-4.
4 gobjc++-4.
4 h
4 iceweasel-l10n-e
4 iceweasel-l10n-k
4 kde-i18n-f
4 kde-i18n-h
4 kde-l10n-e
4 kde-l10n-s
4 kile-i18n-e
4 koffice-i18n-e
4 koffice-i18n-s
4 koffice-l10n-e
4 koffice-l10n-f
4 libqbanking
4 myspell-f
4 myspell-h
4 openoffice.org-help-e
4 openoffice.org-l10n-b
4 openoffice.org-l10n-h
4 openoffice.org-l10n-k
4 sd
4 tcl8.
4 tk8.
5 aspell-e
5 aspell-h
5 iceweasel-l10n-s
5 kde-i18n-b
5 kde-i18n-e
5 kde-i18n-t
5 kde-l10n-k
5 openoffice.org-l10n-e
5 openoffice.org-l10n-t
5 pa
5 tc
6 gc
6 kde-i18n-s
6 libdb4.
6 m
6 openoffice.org-l10n-n
6 openoffice.org-l10n-s
6 s
7 hbf-cns40-
9 gp
But there are also some other interesting observations to make:
- OpenOffice.org seems to have by far the biggest number of localisations, with KDE being 2nd.
- There are 6 version of the Berkeley DB in Debian: libdb4.2 to libdb4.7 (including oldstable as mentioned above)
I leave it as an exercise to the reader to find the full names of the
other package names starting with s, m, gc, pa or tc and having just
one additional character. ;-)
Tagged as: Debian, Etch, Lenny, Myon, names, Other Blogs, packages, Planet Debian, scripting, Sid, Squeeze, statistics
0 comments // show without comments // write a comment //
Related stories
Sunday·08·March·2009
How to make identi.ca talk //at 04:50 //by abe
The listeners of yesterday’s episode of Venty’s Hackerfunk radio show on Radio LoRa already know and heard it: We made identi.ca talk. And we did it with help of other microbloggers. (The podcast version of this Hackerfunk episode will be online in a few days, too. Will link it here and either Venty or me will post it on identi.ca, too, as soon as it’s published.)
A few weeks ago we thought about how we could “show” microblogging on the radio. With identi.ca’s Jabber (XMPP) interface we have real time access, and so the idea was born to pipe all incoming ‘dents into a speech synthesis system.
Then we tried to figure out which tools would be appropriate. Quite fast, people on identi.ca as well as on the LUGS IRC (e.g. bones0) pointed us to festival and espeak. We found no support for German in festival, so we went for espeak – although festival would have had the advantage of the existence of a festival plugin for the popular multiprotocol messenger Pidgin.
Next step was more difficult than expected: How to make a “tail -f” of XMPP incoming messages? Something like rsstail, just for XMPP. Although using the IM to IRC gateway Bitlbee (as I use it myself) and using “tail -f” (or better “inotail -f”) on the IRC client’s log file (ii comes to my mind for such purposes) would have been an option, nobody had the idea at that time.
And since @deepspawn conjured xmpptail in less than two hours we happily took it. xmpptail (tar.gz) is written in Python and uses Twisted Words (Debian package python-twisted-words) as XMPP libraries.
I had to patch xmpptail slightly for unbuffered I/O, Unicode support and for removing things we don’t want to hear on the radio as follows, but it worked more or less out of the box.
--- xmmptail.py 2009-02-25 20:47:48.000000000 +0100 +++ xmpptail.py 2009-03-07 18:48:57.000000000 +0100 @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python -u # -*- coding: utf-8 -*- # author: Carlos A. Perilla# This file is part of Jance bot. @@ -65,7 +65,8 @@ body = unicode(e.__str__()) break - print("%s: %s" % (from_id,body)) +# print("%s: %s" % (from_id,body)) + print("%s" % (body.encode('utf-8'))) def authfailedEvent(xmlstream): @@ -80,9 +81,9 @@ dprint('Got something: %s -> %s' % (el.name, str(el.attributes))) if __name__ == '__main__': - print "Starting" + #print "Starting" execfile('tailconf') - print USER_HANDLE + #print USER_HANDLE me = USER_HANDLE + "/xmpptail" myJid = jid.JID(me) server = USER_HANDLE[USER_HANDLE.find('@')+1:]
So after configuring xmpptail to use the hackerfunk Jabber account, we successfully ran the following script during the radio show:
./xmpptail.py | while read LINE; do
if [ "$LINE" = "empty" ]; then
continue;
fi;
echo $LINE
echo $LINE | tee -a xmpp-espeak.log | espeak --stdin -v de;
done
At the end of the show, @rebugger found this howto which describes very detailed how to get festival working together with the non-free (“non-free” as in DFSG) MBROLA project which offers also the appropriate files for German. But because of how much work this would be to get it running, I currently prefer to stay with espeak for German speech synthesis .
Next step would be to use mnoGosearch’s mguesser to detect the language of a dent and run espeak (or whatever text-to-speech system is appropriate for the guessed language) with the appropiate options for that language, because otherwise many ‘dents sound really funny. ;-)
Update, 15:02: Venty gave the whole system the
name “Identibla”.
Tagged as: Bitlbee, bones0, deepspawn, DFSG, espeak, festival, Hackerfunk, identi.ca, identibla, ii, IM, inotail, IRC, Jabber, language detection, LoRa, MBROLA, mguesser, microblogging, mnoGosearch, non-free, Pidgin, pipe, Python, radio, rebugger, speech synthesis, tail, text to speech, tts, Twisted Words, Venty, XMPP, xmpptail
0 comments // show without comments // write a comment //
Related stories
Monday·02·February·2009
Daily Snapshot .debs of Conkeror //at 01:58 //by abe
Keeping track with packaging software which is under heavy development can be time-consuming. I noticed this while packaging Conkeror, because there was quite a demand for up-to-date packages, especially from upstream themself.
So recently on the IRC channel #conkeror the idea of automatically built Debian packages came up. After a few hours of experimenting and a few days of steadily optimizing, I can proudly present daily built snapshot packages of Conkeror for currently Lenny and Sid, ready to be included in your sources.list:
deb http://noone.org/conkeror-nightly-debs lenny main deb-src http://noone.org/conkeror-nightly-debs lenny main deb http://noone.org/conkeror-nightly-debs sid main deb-src http://noone.org/conkeror-nightly-debs sid main
The binary package conkeror-spawn-process-helper is currently only built for the i386 architecture, but other architectures may follow.
The packages probably work also on any other Debian based distribution (e.g. Ubuntu) which includes XULRunner version 1.9.
Surely they are not of the usual Debian quality, but they should do it for staying up-to-date with the Conkeror development just by using your favourite APT frontend.
The script which generates those packages is also available in the Conkeror git repository at repo.or.cz.
The APTable archive is generated with reprepro. Packages and the repository are signed with the passphrase-less GnuPG key 373B76B4 which is used only for the Conkeror nightly builds. (If anyone knows a better solution for automatic builds than a passphrase-less key, please tell me. :-)
P.S.: I really like the new keybindings “<<”, “>>” and
“G”. :-)
Tagged as: APT, build, Conkeror, daily, deb, Debian, git, GnuPG, gpg, i386, IRC, keybindings, Lenny, nightly, packaging, pgp, repo.or.cz, repository, reprepro, Sid, signing, snapshot, Ubuntu, XULRunner
2 comments // show without comments // write a comment //
Related stories
Friday·23·January·2009
MBC09: The Day Before //at 08:39 //by abe
Helped my parents moving the first half of the week. Left there at Thurdays around 9am. Drove 45min to Zurich. Removed everything bicycle related from my daypack. Left the TomTom at home. (Google Maps on the E51 has to sufficed and sufficed so far.) Crammed cloths for three days in.
Was at Zurich Main Station around 11:40am. My plan was to take the direct ICE train from Zurich to Hamburg Dammtor. Bought a Rivella for the journey.
First suprise at the platform: No ICE train. Instead a Swiss InterCity. The staff told us due to a defect in the ICE train, we have to go to Basel SBB with this train, then switch trains there. No carriage numbers and reservations valid here. Hrmpf. For luck, there where not that many people in the train. No power sockets though.
Next surprise at Basel SBB: No ICE train here either. We’re advised to switch to a German InterCity and then switch again a few kilometers later at Basel Badischer Bahnhof (aka “Basel, German Station”).
There then finally waited an ICE labelled as the initially expected ICE 72 from Zurich to Hamburg Altona. Even the reservations were displayed, departure was though 20min later than the original ICE 72.
The voice from the speakers told us that this is a replacement train which came empty from Zurich. WTF? The next time the voice explained the situation, it was a replacement train coming from Interlaken… Ok, DB is not as insane as I believed for about half an hour. ;-)
Worked though the git tutorial and the git glossary on the train since in future I’ll use git in some of the OSS project I’m working together with — Conkeror beyond others. Also had a conversation with some doctor from University Hospital Zurich who has chasing as hobby. (WTF?)
The train arrived about 45 minutes late at Dammtor, so I first checked in in my hotel (“Hotel am Dammtor”, very close to the MBC09 venue) and then walked to Hamburger Botschaft where the twitter reading was already running, hoping to meet someone I know and having dinner afterwards. Guided by Google Maps on my Nokia E51 it took longer than expected to walk there. And it was windy and raining.
The twitter reading venue was quite full, but I still found a place where I saw most of the screen. At least the reminder of reading was quite funny: #famouslasttweets. They closed with a tweet similar to “And then there’s also identi.ca”. :-)
I was told it wasn’t that funny at the beginning. Didn’t find anyone I really knew, just sticked to a group talking about being hungry. When we met @igorette on our way to some restaurant and he recognised me, I found out that @muhh was also in the group I’m heading though Hamburg.
We had a nice dinner at Schmitt Foxyfood, I had GrillGold (Pommes Frites) with WuchtBrumme (Currywurst) and Fritz Cola.
After dinner, @moeffju drove me and some other guy to our hotels.
So the first evening was already very interesting despite the usual
lateness of Deutsche Bahn.
Tagged as: Basel, Conkeror, DB, Event, Hamburg, Hotel am Dammtor, ICE, identi.ca, igorette, MBC09, Microblogging, moeffju, muhh, Other Blogs, Twitter, twitter reading, Twitterlesung, WTF, Zurich
0 comments // show without comments // write a comment //
Related stories
Wednesday·21·January·2009
Tablet Amora runs on the OpenMoko FreeRunner (updated) //at 19:36 //by abe
Amora (“A MObile Remote Assistant”) is a client/server suite which allows you to remote control an X desktop using a bluetooth enabled mobile phone. Initially there was only a Symbian client (running e.g. on nearly all Nokia E and N series phones), but J2ME clients are under developement, too.
Then there is Tablet Amora (aka Tamora), an Amora “proof of concept” client for the Maemo platform which runs on internet tablets like e.g. the linux based Nokia N770, N800, and N810. Since Maemo isn’t that far away from what runs on the OpenMoko, getting Tamora working on the OpenMoko, too, suggested itself.
Maemo seems to use the deb package format, too, just slightly extended (e.g. by package icons), so it wasn’t even that hard work to adapt the existing Maemo packaging to build, install and run on Debian, too.
So that’s how Tamora looks on the OpenMoko:
The packaging is still far away from Debian standards (throws tons of lintian warnings and the source package generation is b0rked), so yet there are no prebuilt debs available, but you can checkout amora-client from the Subversion repository and build the package from there:
$ svn checkout http://amora.googlecode.com/svn/trunk/amora-client/maemo/ amora-client $ cd amora-client $ debuild -uc -us $ cd .. # dpkg -i amora-client_0.1-2maemo+openmoko_all.deb
For running and installing tamora you need packages from the pkg-fso APT repository on alioth. And to build it, you need the libedje-bin which is available from the pkg-fso repository for at least the armel architecture, or else from Debian experimental. You can add these repositories to your sources.list as follows:
# PKG FSO repository deb http://pkg-fso.alioth.debian.org/debian unstable main deb-src http://pkg-fso.alioth.debian.org/debian unstable main # Debian Experimental deb http://ftp.ch.debian.org/debian experimental main deb-src http://ftp.ch.debian.org/debian experimental main
Since Tamora is yet only a “proof of concept” client, currently only the following remote functions are available:
- pressing arrow key right/left
- pressing F5 (fullscreen for the OpenOffice.org Presenter)
This should though at least suffice for a presentation with the OpenOffice.org Presenter.
To use Tamora to remote control your Debian laptop, you need a bluetooth dongle (or builtin bluetooth support) and amora-server installed as with the Symbian S60 (3rd Edition) Amora client, too.
Update, 23:51
libedje-bin seem not available in the pkg-fso repository for every
architecture. You’ll also find it in Debian experimental. Updated the
sources.list section above appropriately. Thanks to Sebastian Montini
for pointing out this problem.
Tagged as: Amora, bluetooth, deb, Debian, experimental, FreeRunner, FSO, internet tablet, Linux, Maemo, N770, N800, N810, Nokia, OpenMoko, OpenOffice.org, packaging, PoC, Python, S60, Sid, Symbian, Tamora
0 comments // show without comments // write a comment //
Related stories
Monday·19·January·2009
First experiences with Debian on the OpenMoko FreeRunner //at 17:13 //by abe
I ogled with an OpenMoko FreeRunner since Harald König (of X.org fame)’s OpenMoko talk at LinuxDay.at last year. I knew that a team around Luca Capello and Joachim Breitner managed to get Debian running on it.
So when Venty told me that harzi wants to sell his nearly unused FreeRunner, I couldn’t resist and bought it just a few days later.
I played around a little bit with the two distributions which were already installed, AFAIK the original 2007.2 and a version of Qtopia. Called Venty with the Qtopia to prove him that you indeed can make phone calls with this phone, but he wasn’t pleased by the echo he heard of his own voice.
Since the included 512 MB microSD card surely is too small for a large Debian installation, I bought an additional 8 GB microSDHC card at digitec and then installed Debian on it.
The installation mostly went smooth: Partitioning threw a timeout error which didn’t cause any further harm than aborting once. A bigger problem was that the hint that you need to update the U-Boot bootloader itself and not only its configuration (called environement) to get it booting from ext2 partitions. lindi (Timo Lindfors) on #openmoko-debian (on Freenode) was of great help spotting the small details hidden in continuous text.
After having Debian booting I installed all software I wanted to play around on a mobile phone including a bunch of web browsers. But since I ran into a bug which occurs after a non-deterministic amount of data is written to a big microSD card, I quickly got annoyed by the fact that I had to wait for the 8 GB fsck each time this bug was triggered.
So I converted the root file system to ext3 by adding a journal. But whatever I did (reinstalling U-Boot, the U-Boot environement, regenerating the U-Boot environement from scratch, trying to load it as ext2 again, etc.) I didn’t get it to work anymore.
On #openmoko on Freenode, PaulFertser was trying to convince me that Qi is the better choice of a bootloader. Although its description didn’t appeal to me at all, I understand that U-Boot seems a maintainability hell and that a more simplicistic approach can have its advantages. But there was feature listed on the Qi wiki page which made me try it: explicit ext3 support.
After creating the appropriate configuration files and symbolic links in /boot/boot and flashing Qi over the U-Boot in the NAND flash, Debian booted again without problems and with a journaling file system. :-)
In the meanwhile I found a setup which suites my tastes:
- Matchbox stays my window manager, but I enabled the cursor which is very useful if you want to remote control you OpenMoko with synergy. I installed unclutter to automatically hide the cursor after a few seconds, so I see it when it moves, but it goes out of the way when not needed.
- Like on my EeePC, I replaced trayer with lxpanel, because it also provides access to the Debian menu system.
- The best compromise in rendering quality and resource usage is still NetSurf. So that’s my browser on the OpenMoko.
Next step will be to move daily usage from root to an unprivileged user.
As soon as that’s done, I’ll try to get Tablet Amora aka Tamora working on the OpenMoko, too. Currently it only runs on Nokia’s Linux based internet tablets (N800, N810, etc.).
Update, 17:54
To answer Joachim’s question in the comment: I don’t plan to use it as
daily phone, but it may replace my old Nokia 6310i where currently my
German mobile phone SIM card resides in. Use it mainly to have a cheap
way to make phone calls inside Germany.
Tagged as: #lugs, amora, bootloader, cursor, Debian, Event, ext2, ext3, FreeRunner, fsck, GTA02, Harald König, harzi, IRC, Lenny, Linux, LinuxDay.at, LUGS, lxpanel, matchbox, microSD, microSDHC, NetSurf, Nokia, OpenMoko, Qi, Qtopia, synergy, tamora, U-Boot, unclutter, Ventilator
2 comments // show without comments // write a comment //




