Installing the Takeoff Launcher in KDE 4.8.0

My application launcher of choice is Lancelot, which comes as part of the package kde-base/kdeplasma-addons. If you haven’t already tried it, you really should.

Anyway, recently on the blogsphere I read about Takeoff, another Plasmoid application launcher for KDE, first issued end July 2011. Looking at screen snapshots of Takeoff reminded me of a tablet’s screen: an uncluttered array of large application icons. My curiosity was piqued, so I decided to install the Takeoff Plasmoid. Here’s what I did to install it in KDE 4.8.0 in Gentoo Linux. The same straightforward procedure should also work in other Linux distributions with KDE 4.8, although installation is a bit easier for Arch Linux, Chakra, Fedora, openSUSE and Ubuntu, as packages exist for those distributions (see the Download page on the project’s Web site for details).

I downloaded takeoff-1.0.tar.gz to ~/Desktop

I right-clicked on the tarball and selected Extract > Extract Archive To… and extracted the files to the directory ~/takeoff-1.0

I opened a Konsole window and entered the following commands:

cd ~/takeoff-1.0

cat README

The README file tells you exactly how to install the Plasma widget (although I ignored the instruction to create the directory ~/takeoff-1.0/build/ as it already existed):

cd build

cmake .. && make

sudo make install

kbuildsycoca4

Then I did the usual in KDE to add the Takeoff widget to the Panel.

To configure Takeoff I right-clicked on its icon, clicked on ‘Takeoff Settings’ and, under ‘General Settings’, I unticked ‘Show Takeoff in full screen mode’. I also clicked on the icon under ‘General Settings’ and changed the icon to one of my choice. If you fancy a picture as the background of the launcher’s panel, tick ‘Show background image’, click on the ‘browse for file’ icon and select any wallpaper file that you have stored on your disk. There are other configuration options you can play with, such as the number of columns and rows of application icons to display in the launcher’s panel.

To display the launcher’s panel, just click on the Takeoff icon on your Panel. The Takeoff panel will pop up, as shown in the snaphot below of my screen.

Takeoff Launcher in KDE 4.8.0

Notice that there are tabs across the top of the launcher’s panel; these are the different categories of application available: Favourites, All Applications, Accessories, Education, Games, Graphics, Internet, Office, and so on. Click on one of these tabs to view all the applications in that category. If there are too many applications in that category to fit on the launcher’s panel, there will be a slider button at the bottom of the panel; just click on the next number on it to view the next page of applications in the category.

By the way, in case you’re wondering, naturally those are Gentoo penguins on my Desktop wallpaper. :-)

EDIT (July 10, 2012): For users of Gentoo there is now an ebuild (kde-misc/takeoff) in the Portage main tree, so use that to install Takeoff Launcher.

Moving Compiz to a local overlay in Gentoo

Sadly, Compiz’s heyday has passed and the Compiz ebuilds in the Gentoo Portage main tree were recently masked for removal. I rarely use Compiz these days, as KWin’s Desktop Effects are now almost as good. Nevertheless I want to keep Compiz installed for the time being, so I decided to move the ebuilds to a local overlay before the Gentoo developers remove them from the main Portage tree. Here’s how I did it.

The masked Compiz packages installed on my machine were:

# eix -I compiz
[D] dev-python/compizconfig-python
Available versions: [M](~)0.8.4 [M](~)0.8.4-r1 [M](~)0.8.4-r3
Installed versions: 0.8.4-r3(00:52:18 01/09/11)
Homepage: http://www.compiz.org/
Description: Compizconfig Python Bindings

[D] x11-libs/compiz-bcop
Available versions: [M](~)0.8.4
Installed versions: 0.8.4(23:33:17 27/08/11)
Homepage: http://www.compiz.org/
Description: Compiz Option code Generator

[D] x11-libs/compizconfig-backend-gconf
Available versions: [M](~)0.8.4-r2
Installed versions: 0.8.4-r2(18:39:26 27/08/11)
Homepage: http://www.compiz.org/
Description: Compizconfig Gconf Backend

[D] x11-libs/compizconfig-backend-kconfig4
Available versions: [M](~)0.8.4 {aqua}
Installed versions: 0.8.4(23:35:31 27/08/11)(-aqua -kdeenablefinal)
Homepage: http://www.compiz.org/
Description: Compizconfig Kconfig Backend

[D] x11-libs/libcompizconfig
Available versions: [M](~)0.8.4-r2!t
Installed versions: 0.8.4-r2!t(18:32:41 27/08/11)
Homepage: http://www.compiz.org/
Description: Compiz Configuration System

[D] x11-plugins/compiz-plugins-extra
Available versions: [M](~)0.8.6-r1 {gconf libnotify}
Installed versions: 0.8.6-r1(23:35:08 27/08/11)(libnotify -gconf)
Homepage: http://www.compiz.org/
Description: Compiz Fusion Window Decorator Extra Plugins

[D] x11-plugins/compiz-plugins-main
Available versions: [M](~)0.8.6-r1 {gconf}
Installed versions: 0.8.6-r1(18:33:51 27/08/11)(-gconf)
Homepage: http://www.compiz.org/
Description: Compiz Fusion Window Decorator Plugins

[D] x11-plugins/compiz-plugins-unsupported
Available versions: [M](~)0.8.4-r1!m
Installed versions: 0.8.4-r1!m(18:36:55 27/08/11)
Homepage: http://www.compiz.org/
Description: Compiz Fusion Window Decorator Unsupported Plugins

[D] x11-wm/compiz
Available versions: [M](~)0.8.6-r3 {+cairo fuse gconf gnome gtk kde +svg}
Installed versions: 0.8.6-r3(18:54:59 23/11/11)(cairo gtk kde svg -fuse -gconf -gnome)
Homepage: http://www.compiz.org/
Description: OpenGL window and compositing manager

[D] x11-wm/compiz-fusion
Available versions: [M](~)0.8.4-r1 [M](~)0.8.6 {emerald gnome kde unsupported}
Installed versions: 0.8.6(18:55:16 23/11/11)(emerald kde -gnome -unsupported)
Homepage: http://www.compiz.org/
Description: Compiz Fusion (meta)

Found 10 matches.
# eix -I fusion
[D] x11-apps/fusion-icon
Available versions: [M](~)0.1-r2 {gtk qt4}
Installed versions: 0.1-r2(18:55:09 23/11/11)(gtk qt4)
Homepage: http://compiz-fusion.org
Description: Compiz Fusion Tray Icon and Manager

[D] x11-wm/compiz-fusion
Available versions: [M](~)0.8.4-r1 [M](~)0.8.6 {emerald gnome kde unsupported}
Installed versions: 0.8.6(18:55:16 23/11/11)(emerald kde -gnome -unsupported)
Homepage: http://www.compiz.org/
Description: Compiz Fusion (meta)

Found 2 matches.
# eix -I ccsm
[D] x11-apps/ccsm
Available versions: [M](~)0.8.4-r1
Installed versions: 0.8.4-r1(23:33:31 27/08/11)
Homepage: http://www.compiz.org/
Description: Compizconfig Settings Manager

# eix -I emerald
[D] x11-themes/emerald-themes
Available versions: [M](~)0.5.2
Installed versions: 0.5.2(18:47:58 27/01/11)
Homepage: http://compiz-fusion.org
Description: Emerald window decorator themes

[D] x11-wm/emerald
Available versions: [M](~)0.8.4-r2
Installed versions: 0.8.4-r2(21:28:46 27/08/11)
Homepage: http://www.compiz.org/
Description: Emerald Window Decorator

Found 2 matches.

Using the locate command I quickly located the ebuilds:

/usr/portage/dev-python/compizconfig-python/compizconfig-python-0.8.4-r3.ebuild
/usr/portage/x11-libs/compiz-bcop/compiz-bcop-0.8.4.ebuild
/usr/portage/x11-libs/compizconfig-backend-gconf/compizconfig-backend-gconf-0.8.4-r2.ebuild
/usr/portage/x11-libs/compizconfig-backend-kconfig4/compizconfig-backend-kconfig4-0.8.4.ebuild
/usr/portage/x11-libs/libcompizconfig/libcompizconfig-0.8.4-r2.ebuild
/usr/portage/x11-plugins/compiz-plugins-extra/compiz-plugins-extra-0.8.6-r1.ebuild
/usr/portage/x11-plugins/compiz-plugins-main/compiz-plugins-main-0.8.6-r1.ebuild
/usr/portage/x11-plugins/compiz-plugins-unsupported/compiz-plugins-unsupported-0.8.4-r1.ebuild
/usr/portage/x11-wm/compiz/compiz-0.8.6-r3.ebuild
/usr/portage/x11-wm/compiz-fusion/compiz-fusion-0.8.6.ebuild
/usr/portage/x11-apps/fusion-icon/fusion-icon-0.1-r2.ebuild
/usr/portage/x11-apps/ccsm/ccsm-0.8.4-r1.ebuild
/usr/portage/x11-themes/emerald-themes/emerald-themes-0.5.2.ebuild
/usr/portage/x11-wm/emerald/emerald-0.8.4-r2.ebuild

I first created the necessary directories in my local overlay:

mkdir -p /usr/local/portage/dev-python/compizconfig-python
mkdir -p /usr/local/portage/x11-libs/compiz-bcop
mkdir -p /usr/local/portage/x11-libs/compizconfig-backend-gconf
mkdir -p /usr/local/portage/x11-libs/compizconfig-backend-kconfig4
mkdir -p /usr/local/portage/x11-libs/libcompizconfig
mkdir -p /usr/local/portage/x11-plugins/compiz-plugins-extra
mkdir -p /usr/local/portage/x11-plugins/compiz-plugins-main
mkdir -p /usr/local/portage/x11-plugins/compiz-plugins-unsupported
mkdir -p /usr/local/portage/x11-wm/compiz
mkdir -p /usr/local/portage/x11-wm/compiz-fusion
mkdir -p /usr/local/portage/x11-apps/fusion-icon
mkdir -p /usr/local/portage/x11-apps/ccsm
mkdir -p /usr/local/portage/x11-themes/emerald-themes
mkdir -p /usr/local/portage/x11-wm/emerald

Then I copied the ebuilds and associated files into each directory and generated a manifest for each:

cd /usr/local/portage/dev-python/compizconfig-python
cp -r /usr/portage/dev-python/compizconfig-python/* .
ebuild compizconfig-python-0.8.4-r3.ebuild manifest
cd /usr/local/portage/x11-libs/compiz-bcop
cp -r /usr/portage/x11-libs/compiz-bcop/* .
ebuild compiz-bcop-0.8.4.ebuild manifest
cd /usr/local/portage/x11-libs/compizconfig-backend-gconf
cp -r /usr/portage/x11-libs/compizconfig-backend-gconf/* .
ebuild compizconfig-backend-gconf-0.8.4-r2.ebuild manifest
cd /usr/local/portage/x11-libs/compizconfig-backend-kconfig4
cp -r /usr/portage/x11-libs/compizconfig-backend-kconfig4/* .
ebuild compizconfig-backend-kconfig4-0.8.4.ebuild manifest
cd /usr/local/portage/x11-libs/libcompizconfig
cp -r /usr/portage/x11-libs/libcompizconfig/* .
ebuild libcompizconfig-0.8.4-r2.ebuild manifest
cd /usr/local/portage/x11-plugins/compiz-plugins-extra
cp -r /usr/portage/x11-plugins/compiz-plugins-extra/* .
ebuild compiz-plugins-extra-0.8.6-r1.ebuild manifest
cd /usr/local/portage/x11-plugins/compiz-plugins-main
cp -r /usr/portage/x11-plugins/compiz-plugins-main/* .
ebuild compiz-plugins-main-0.8.6-r1.ebuild manifest
cd /usr/local/portage/x11-plugins/compiz-plugins-unsupported
cp /usr/portage/x11-plugins/compiz-plugins-unsupported/* .
ebuild compiz-plugins-unsupported-0.8.4-r1.ebuild manifest
cd /usr/local/portage/x11-wm/compiz
cp -r /usr/portage/x11-wm/compiz/* .
ebuild compiz-0.8.6-r3.ebuild manifest
cd /usr/local/portage/x11-wm/compiz-fusion
cp -r /usr/portage/x11-wm/compiz-fusion/* .
ebuild compiz-fusion-0.8.6.ebuild manifest
cd /usr/local/portage/x11-apps/fusion-icon
cp -r /usr/portage/x11-apps/fusion-icon/* .
ebuild fusion-icon-0.1-r2.ebuild manifest
cd /usr/local/portage/x11-apps/ccsm
cp -r /usr/portage/x11-apps/ccsm/* .
ebuild ccsm-0.8.4-r1.ebuild manifest
cd /usr/local/portage/x11-themes/emerald-themes
cp -r /usr/portage/x11-themes/emerald-themes/* .
ebuild emerald-themes-0.5.2.ebuild manifest
cd /usr/local/portage/x11-wm/emerald
cp -r /usr/portage/x11-wm/emerald/* .
ebuild emerald-0.8.4-r2.ebuild manifest

My /etc/make.conf file contains the following lines required for my local overlay and to accept any licences:

PORTDIR_OVERLAY="${PORTDIR_OVERLAY} /usr/local/portage/"
ACCEPT_LICENSE="*"

and I named my local overlay ‘local_overlay’:

mkdir /usr/local/portage/profiles
echo "local_overlay" > /usr/local/portage/profiles/repo_name

I then unmasked the ebuilds in my local overlay by listing them in the file
/etc/portage/package.unmask:

=dev-python/compizconfig-python-0.8.4-r3::local_overlay
=x11-libs/compiz-bcop-0.8.4::local_overlay
=x11-libs/compizconfig-backend-gconf-0.8.4-r2::local_overlay
=x11-libs/compizconfig-backend-kconfig4-0.8.4::local_overlay
=x11-libs/libcompizconfig-0.8.4-r2::local_overlay
=x11-plugins/compiz-plugins-extra-0.8.6-r1::local_overlay
=x11-plugins/compiz-plugins-main-0.8.6-r1::local_overlay
=x11-plugins/compiz-plugins-unsupported-0.8.4-r1::local_overlay
=x11-wm/compiz-0.8.6-r3::local_overlay
=x11-wm/compiz-fusion-0.8.6::local_overlay
=x11-apps/fusion-icon-0.1-r2::local_overlay
=x11-apps/ccsm-0.8.4-r1::local_overlay
=x11-themes/emerald-themes-0.5.2::local_overlay
=x11-wm/emerald-0.8.4-r2::local_overlay

I right-clicked on the Fusion Icon on the Panel and selected Quit, then I uninstalled the packages and reinstalled them from my local overlay:

emerge -aC compizconfig-python compiz-bcop compizconfig-backend-gconf compizconfig-backend-kconfig4 libcompizconfig compiz-plugins-extra compiz-plugins-main compiz-plugins-unsupported compiz compiz-fusion fusion-icon ccsm emerald-themes emerald

USE="-kde qt4" emerge -1v compizconfig-python compiz-bcop compizconfig-backend-gconf compizconfig-backend-kconfig4 libcompizconfig compiz-plugins-extra compiz-plugins-main compiz-plugins-unsupported compiz compiz-fusion fusion-icon ccsm emerald-themes emerald

The installed packages are now:

# eix -I compiz
[I] dev-python/compizconfig-python
Available versions: [M](~)0.8.4 {M}(~)0.8.4[1] [M](~)0.8.4-r1 {M}(~)0.8.4-r1[1] [M](~)0.8.4-r3 {M}(~)0.8.4-r3[1]
Installed versions: 0.8.4-r3[1](02:03:18 28/01/12)
Homepage: http://www.compiz.org/
Description: Compizconfig Python Bindings

[I] x11-libs/compiz-bcop
Available versions: [M](~)0.8.4 {M}(~)0.8.4[1]
Installed versions: 0.8.4[1](02:01:00 28/01/12)
Homepage: http://www.compiz.org/
Description: Compiz Option code Generator

[I] x11-libs/compizconfig-backend-gconf
Available versions: [M](~)0.8.4-r2 {M}(~)0.8.4-r2[1]
Installed versions: 0.8.4-r2[1](02:03:34 28/01/12)
Homepage: http://www.compiz.org/
Description: Compizconfig Gconf Backend

[I] x11-libs/compizconfig-backend-kconfig4
Available versions: [M](~)0.8.4 {M}(~)0.8.4[1] {aqua}
Installed versions: 0.8.4[1](02:03:59 28/01/12)(-aqua)
Homepage: http://www.compiz.org/
Description: Compizconfig Kconfig Backend

[I] x11-libs/libcompizconfig
Available versions: [M](~)0.8.4-r2!t {M}(~)0.8.4-r2!t[1]
Installed versions: 0.8.4-r2!t[1](02:01:31 28/01/12)
Homepage: http://www.compiz.org/
Description: Compiz Configuration System

[I] x11-plugins/compiz-plugins-extra
Available versions: [M](~)0.8.6-r1 {M}(~)0.8.6-r1[1] {gconf libnotify}
Installed versions: 0.8.6-r1[1](02:05:19 28/01/12)(libnotify -gconf)
Homepage: http://www.compiz.org/
Description: Compiz Fusion Window Decorator Extra Plugins

[I] x11-plugins/compiz-plugins-main
Available versions: [M](~)0.8.6-r1 {M}(~)0.8.6-r1[1] {gconf}
Installed versions: 0.8.6-r1[1](02:02:55 28/01/12)(-gconf)
Homepage: http://www.compiz.org/
Description: Compiz Fusion Window Decorator Plugins

[I] x11-plugins/compiz-plugins-unsupported
Available versions: [M](~)0.8.4-r1!m {M}(~)0.8.4-r1!m[1]
Installed versions: 0.8.4-r1!m[1](02:06:11 28/01/12)
Homepage: http://www.compiz.org/
Description: Compiz Fusion Window Decorator Unsupported Plugins

[I] x11-wm/compiz
Available versions: [M](~)0.8.6-r3 {M}(~)0.8.6-r3[1] {+cairo fuse gconf gnome gtk kde +svg}
Installed versions: 0.8.6-r3[1](02:41:46 28/01/12)(cairo gtk svg -fuse -gconf -gnome -kde)
Homepage: http://www.compiz.org/
Description: OpenGL window and compositing manager

[I] x11-wm/compiz-fusion
Available versions: [M](~)0.8.4-r1 {M}(~)0.8.4-r1[1] [M](~)0.8.6 {M}(~)0.8.6[1] {emerald gnome kde unsupported}
Installed versions: 0.8.6[1](02:07:11 28/01/12)(emerald -gnome -kde -unsupported)
Homepage: http://www.compiz.org/
Description: Compiz Fusion (meta)

[1] "local_overlay" /usr/local/portage

Found 10 matches.
# eix -I fusion
[I] x11-apps/fusion-icon
Available versions: [M](~)0.1-r2 {M}(~)0.1-r2[1] {gtk qt4}
Installed versions: 0.1-r2[1](02:06:20 28/01/12)(gtk qt4)
Homepage: http://compiz-fusion.org
Description: Compiz Fusion Tray Icon and Manager

[I] x11-wm/compiz-fusion
Available versions: [M](~)0.8.4-r1 {M}(~)0.8.4-r1[1] [M](~)0.8.6 {M}(~)0.8.6[1] {emerald gnome kde unsupported}
Installed versions: 0.8.6[1](02:07:11 28/01/12)(emerald -gnome -kde -unsupported)
Homepage: http://www.compiz.org/
Description: Compiz Fusion (meta)

[1] "local_overlay" /usr/local/portage

Found 2 matches.
# eix -I ccsm
[I] x11-apps/ccsm
Available versions: [M](~)0.8.4-r1 {M}(~)0.8.4-r1[1]
Installed versions: 0.8.4-r1[1](02:05:30 28/01/12)
Homepage: http://www.compiz.org/
Description: Compizconfig Settings Manager

[1] "local_overlay" /usr/local/portage
# eix -I emerald
[I] x11-themes/emerald-themes
Available versions: [M](~)0.5.2 {M}(~)0.5.2[1]
Installed versions: 0.5.2[1](02:07:05 28/01/12)
Homepage: http://compiz-fusion.org
Description: Emerald window decorator themes

[I] x11-wm/emerald
Available versions: [M](~)0.8.4-r2 {M}(~)0.8.4-r2[1]
Installed versions: 0.8.4-r2[1](02:06:55 28/01/12)
Homepage: http://www.compiz.org/
Description: Emerald Window Decorator

[1] "local_overlay" /usr/local/portage

Found 2 matches.

I launched KRunner (Alt-F2) and entered the command “fusion-icon” (without the quotes) to get the Fusion Icon back on the Panel, and then rebooted to check if everything was working correctly.

The only way I could get compiz-0.8.6-r3 to build this time was to specify "-kde" as a USE flag. The last time I merged that package, back in November 2011, it would build with USE="kde qt4" and enable me to select Emerald, GTK Window Decorator or KDE Window Decorator as the window decorator in Compiz. But, as the package will no longer build with the kde USE flag, I now only have the choice of Emerald or GTK Window Decorator. Perhaps this old, unmaintained compiz ebuild will no longer build with USE="kde" because I have since installed new versions of other packages on which it depends, and/or because I am now using KDE 4.8.0 instead of KDE 4.7.3. Anyway, at least I now have Compiz available for a while yet and can still select KWin or Compiz as the Window Manager.

EDIT (February 1, 2012): The stuff overlay has the following ebuilds, which do enable the KDE4 Window Decorator to be used with Compiz in KDE 4.8.0:

dev-python/compizconfig-python-0.8.4-r3
x11-libs/compiz-bcop-0.8.8
x11-libs/compizconfig-backend-gconf-0.8.8
x11-libs/compizconfig-backend-kconfig4-0.8.8
x11-libs/libcompizconfig-0.8.8
x11-plugins/compiz-plugins-extra-0.8.8
x11-plugins/compiz-plugins-main-0.8.8
x11-plugins/compiz-plugins-unsupported-0.8.8
x11-wm/compiz-0.8.8
x11-wm/compiz-fusion-0.8.8
x11-apps/fusion-icon-0.1-r2
x11-apps/ccsm-0.8.4-r1
x11-themes/emerald-themes-0.5.2
x11-wm/emerald-0.8.8

which can be installed as follows:

# layman -a stuff
# USE="kde qt4" emerge -1v compizconfig-python::stuff compiz-bcop::stuff compizconfig-backend-gconf::stuff compizconfig-backend-kconfig4::stuff libcompizconfig::stuff compiz-plugins-extra::stuff compiz-plugins-main::stuff compiz-plugins-unsupported::stuff compiz::stuff compiz-fusion::stuff fusion-icon::stuff ccsm::stuff emerald-themes::stuff emerald::stuff

Setting up a talking clock easily in Linux

There are several ways to set up a talking clock in Linux. One simple way to do it if you’re a KDE user is to use the Analogue Clock widget. Once you have placed the Analogue Clock widget on your Desktop, click on the widget’s spanner icon, select the ‘General’ tab and it shows the title ‘Text to Speech’ and a ‘Speak time’ box where you can select the frequency at which you want the talking clock to speak the time. When you click ‘Apply’, an icon appears in the System Tray on the Panel: Jovie KDE Text-to-speech Manager. You can right-click on the Jovie icon then click on ‘Configure’ to change the language and voice etc.

Another alternative is to install the eSpeak text-to-speech synthesizer and use the GUI KAlarm utility to run the following command at any interval you like (every hour, every half hour, every 15 minutes or whatever you want):

date +%I:%M%p | espeak

When the command above is executed on the hour, the voice speaks the hour followed by “zero zero AM/PM”. For example it says “seven zero zero PM” rather than “seven o’clock PM”. If you prefer the latter, you can modify the one-line command:

if [ $(date +%M) != "00" ]; then date +%-H:%M%p%Z; else echo -n $(date +%-H); echo -n "oh clock "; date +%p; date +%Z; fi | espeak -ven+f6

Use the command date --help to find out the different parameters available for the date command. You can also play around with the last two characters in the above command to get different voices. For example “m1″, “f4″ etc.

Using KAlarm’s GUI is less daunting for many people than setting up a cronjob to run the command, which would be yet another way of doing it. Also, by using KAlarm it is quick and easy to enable and disable the talking clock.

An alternative to the above command would be to run one of the many Bash scripts found on the Web. One such is saytime. SayTime uses the festival text-to-speech engine, an alternative to espeak, which you would need to install. The guts of SayTime is simply the command:

echo "Today is `date +%d` `date +%B` `date +%Y` and now the time is `date +%k` and `date +%M` minutes" | festival --tts

so you could use that command with KAlarm or a cronjob if you wanted. You can play around with the commands to get the time spoken the way you want.

eSpeak is also configurable; check out the Web site eSpeak text to speech. For example, the following is the time spoken in Portuguese instead of English:

date +%I:%M%p | espeak -vpt

or in English with a Scottish accent:

date +%I:%M%p | espeak -ven-sc

or in English with a Brummie accent:

date +%I:%M%p | espeak -ven-wm

or in Latin with a female voice:

date +%I:%M%p | espeak -vla+f4

Three guesses what this one does:

date +%I:%M%p | espeak -ven+whisper

You can have some fun exploring the options.

Playing QuickTime videos in Firefox and Chromium + XVideo bug in AMD Catalyst 11.11 and 11.12 driver

Video problems seem to be perennial in Linux. The latest two to affect me were:

1) Firefox and Chromium could no longer play QuickTime videos on the Apple iTunes Movie Trailers Web site;

2) a bug in the latest two releases of the closed-source ATI FGLRX driver (AMD Catalyst 11.11 and 11.12 for Linux) that causes the X.Org Server to crash when I try to play .mov files using XVideo (Xv) output in media players such as SMPlayer, VLC, GNOME-MPlayer etc. (see e.g. Gentoo Bug Report No. 391193).

The reason I mention these two problems in the same breath is because I encountered the second whilst trying to fix the first. Anyway, below I explain what I did to resolve the two problems.

I first had a problem displaying QuickTime movie trailers in Firefox a couple of years ago. The solution then was to install the User Agent Switcher add-on for Firefox and create a user agent to fool the Apple Web site into thinking Firefox was using Apple’s QuickTime browser plugin instead of mplayerplug-in for Linux. But within a few days Firefox again could not play movie trailers on the Apple Web site. I had to uninstall mplayerplug-in and install the then latest version of its successor, gecko-mediaplayer (which uses gnome-mplayer). All was good again until…

Several months ago I found that, yet again, Firefox could not play movie trailers on the Apple Web site. I tried to view the trailers in Chromium instead but had the same problem. Both browsers just displayed a black box where the video should be playing. A little searching on the Web led me to the conclusion that the problem lay with the latest version of gecko-mediaplayer and gnome-mplayer that I was using at the time, so I gave up and decided to wait for new versions of gecko-mediaplayer and gnome-mplayer to be released.

Now, yesterday I wanted to watch a particular trailer on the Apple Web site, but, despite having installed the latest version of gecko-mediaplayer and gnome-mplayer anyway a few days ago, neither Firefox nor Chromium would display the trailer. A little searching on the Web suggested that I should try mozplugger instead of gecko-mediaplayer, so I uninstalled the latter, installed mozplugger and… the black box in the browser was replaced by a white box displaying the QuickTime ‘Q’ logo and a message that I needed to install QuickTime. Argghh!

So I uninstalled mozplugger and reinstalled gecko-mediaplayer and gnome-mplayer (the same versions that I installed recently, you inderstand). This time my attempts to watch trailers on the Apple Web site resulted in Firefox and Chromium displaying grey boxes and appearing to download the QuickTime videos, but then the X.Org Server crashed, restarted and the Desktop Environment’s login screen appeared. Furthermore, when I tried playing .mov videos in VLC, the same thing happened. Perhaps now you may understand why I mentioned above the bug with the FGLRX driver? It took me a few hours to realise there were two separate problems here.

The work-around to the second problem was to configure media players to use a different output driver rather than the XVideo (Xv) output driver. For example, in VLC this is done via Tools > Preferences > Video and selecting ‘GLX video output (XCB)’ as the Output under Video Settings. For SMPlayer this is done via Options > Preferences > General and selecting ‘gl (fast – ATI cards)’ as the Output driver under the Video tab.

And, most importantly, in order to enable gecko-mediaplayer to display those Apple QuickTime trailers in Firefox and Chromium I had to launch gnome-mplayer, select Edit > Preferences, click on the Player tab and select ‘gl’ as the Video Output under Adjust Output Settings. Actually, clicking on the MPlayer tab and entering “-vo gl” (without the quotes) in the ‘Extra Options to MPlayer:’ box achieves the same result. By the way, the tickboxes QuickTime Emulation, RealPlayer Emulation, Windows Media Player Emulation and DIVX Player Emulation were already ticked on the Plug-in tab.

So, there you have it. After several hours of searching and tinkering I can again watch movie trailers on the Apple Web site. Don’t you just love Linux?

For the sake of completeness, below I list the versions of the applicable packages currently installed on my main laptop:

firefox-9.0
chromium-16.0.912.63
gecko-mediaplayer-1.0.5_beta1_p20111207
gnome-mplayer-1.0.5_beta1
mplayer-1.0_rc4_p20111215
ffmpeg-0.9
libquicktime-1.2.3-r1
xorg-server-1.11.2-r2
ati-drivers-11.12

EDIT (January 2, 2012): I’ve just had a thought: When I used Skype for Linux a few days ago, my laptop rebooted spontaneously as soon as the person at the other end enabled her Webcam in Skype for Windows. This was reproducible consistently. However, I could enable my Webcam, she could see me in Skype on her PC, and I could also see video of me in Skype’s ‘myself preview’ on my laptop. Now, it could be a coincidence but I wonder if the reboot occurred because Skype for Linux uses XVideo? Skype’s Web page for Skype for Linux lists “Video card driver with Xv support” as one of the hardware requirements, which looks pretty conclusive to me. However, this leaves a couple of niggling questions: a) If Skype does indeed use XVideo, why didn’t the ‘myself preview’ video in the Skype for Linux window crash the X.Org Server?. b) If the FGLRX driver bug is the cause, why did my laptop reboot instead of just the X.Org Server crashing, restarting and displaying the Desktop Environment login screen? Furthermore, Skype’s Options > Video Devices > Test does work correctly on my laptop. So perhaps the rebooting problem is caused by a different bug. Suspicious, though. Unfortunately, as far as I know there is no way of switching Skype to use OpenGL instead of XVideo, so I cannot prove that XVideo is the cause of this particular problem I’m experiencing with Skype.

How to install and use Tor for anonymous browsing or to access country-restricted content from another country

Some people want to browse the Web in complete anonymity. One tool for doing that is Tor. However, there are other reasons for using Tor. For example, when I am travelling in a country where the government blocks certain Web sites (or blocks accessing content on certain Web sites), or when I am travelling overseas and certain Web sites back home will not let me view content (e.g. TV shows), I use Tor. Note that some Web sites are now clever enough to detect that you are accessing them via a proxy and could be overseas, so even Tor will not gain you access to media on some Web sites back home. Anyway, it’s still worth trying Tor to see if it works in your case.

For an overview of the installation and configuration procedure, see Running the Tor client on Linux/BSD/Unix. Below I will explain how to install and use Tor in Gentoo Linux.

Before you use Tor, it is useful to check your current IP address. Several Web sites will tell you your current IP address; here is the site I usually use: http://whatismyipaddress.com/

1. Install Tor:

# USE="tordns" emerge -1v tor

(Actually, the more-recent versions of the tor package don’t require that USE flag but I’ve left it in as it does no harm.)

2. Install Vidalia:

# cd /usr/portage/distfiles/
# wget --no-check-certificate https://www.torproject.org/dist/vidalia/vidalia-x.y.z.tar.gz
# USE="tor" emerge -1v vidalia

Use the current version x.y.z of the vidalia package in the package manager and https://www.torproject.org/dist/vidalia/

3. Install Polipo:

# emerge -1v polipo

4. Download polipo.conf

# cd /etc/polipo
# wget --no-check-certificate https://gitweb.torproject.org/torbrowser.git/blob_plain/HEAD:/build-scripts/config/polipo.conf

Edit April 21, 2013: The above URL is now:

https://gitweb.torproject.org/torbrowser.git/blob_plain/ae4aa49ad9100a50eec049d0a419fac63a84d874:/build-scripts/config/polipo.conf

5. Edit it and change proxyPort = 8118 to proxyPort = 8123

6. Copy it to /etc/polipo/:

# cd /etc/polipo
# cp /etc/polipo/config /etc/polipo/config.bak
# cp polipo.conf config

7. Configure Firefox:

Edit > Preferences > Network > Settings

Manual proxy configuration:

HTTP Proxy: 127.0.0.1 Port: 8123
SSL Proxy: 127.0.0.1 Port 8123

SOCKS Host: 127.0.0.1 Port 9051
SOCKS v5
No Proxy for: 127.0.0.1

8. Run Vidalia and then configure it:

$ vidalia &

a) Settings > Sharing

Select ‘Run as a client only’

b) Settings > Advanced

Select ‘Use TCP connection (ControlPort)’
Address: 127.0.0.1 9051

Tor Configuration File:
/home/fitzcarraldo/.vidalia/torrc

Data Directory:
/home/fitzcarraldo/.tor

c) Click on ‘Edit current torrc’ and make it:

# This file was generated by Tor; if you edit it, comments will not be preserved
# The old torrc file was renamed to torrc.orig.1 or similar, and Tor will ignore it
ControlPort 9051
ExitNodes {gb}
Log notice stdout
SocksListenAddress 127.0.0.1
StrictNodes 1

Note that I have specified “{gb}” above so that I am perceived by Web sites to be browsing in the UK even if I am in another country. But you can use a different country code if you want Web sites to perceive you are in another country. For example, “{us}” would make it look as if you are browsing in the USA.

9. Run Polipo:

$ sudo polipo

10. Surf to http://torcheck.xenobite.eu/ to check that you are now using a Tor exit node.

11. Surf to http://whatismyipaddress.com/ to check that your IP address has changed.

Sabayon Linux developers split the Portage sabayon overlay into two new overlays

If you are a Gentoo Linux user who added the sabayon overlay, or if you are a Sabayon Linux user who already uses Portage, note that the developers of Sabayon Linux have just split the overlay into two overlays. One of the overlays (sabayon-distro) contains ebuilds that are specific to the Sabayon Linux distribution and unlikely to be of interest to users of other distributions that use the Portage package manager. The other overlay (sabayon) contains ebuilds that could be of interest to Portage users of other distributions. For example, the package app-misc/sabayon-version will only be of relevance to users of Sabayon Linux, so you’ll only find it in the sabayon-distro overlay, not the sabayon overlay:

# eix sabayon-version
* app-misc/sabayon-version [1]
Available versions: (~)5-r5 (~)7-r1
Homepage: http://www.sabayon.org/
Description: Sabayon System Release virtual package

[1] "sabayon-distro" /var/lib/layman/sabayon-distro

All you need to do in order to cater for this change is the following as root user:

layman -d sabayon
layman -S
layman -a sabayon
layman -a sabayon-distro
eix-update

You only need to add the sabayon-distro overlay if you are a user of Sabayon Linux or want to install any of the distribution-specific ebuilds from it. Of course omit the eix-update command if you do not have the excellent eix utility installed.

From then onwards you can just continue as normal using the usual Portage commands as root user in order to synchronise the main Portage tree and synchronise all the overlays added on your machine:

emerge --sync
layman -S
eix-update

or, if you have an asterisk on its own line in the file /etc/eix-sync.conf then you can replace the above three commands with the following single command:

eix-sync

Secure deletion of a file via the KDE GUI

One of the various Linux tools for secure deletion of files is the srm command. In Gentoo Linux the srm command and other security-related commands are available by installing the package secure-delete. Now, srm is easy enough to use from the command line:

$ srm mysecrets.doc

You can do the same thing from the KDE GUI very easily by adding the srm command to the KDE Service Menu. To do this, first install KDE Service Menu Editor. Then launch it and do the following:

On the Actions tab:

1. Enter “Securely Delete” (without the quotes) in the Label box.

2. Enter srm -r %u in the Exec box. As you will see if you use the man srm command, the “-r” option means “recursive mode, deletes all subdirectories”. I’ve added this option so that I can securely delete directories and all their contents including sub-directories, as well as individual files.

3. Click on the blank Icon and choose a suitable icon. I selected System Icons > Actions, entered “delete” (without the quotes) in the Search box and selected the big red X (edit-delete) icon.

On the Conditions tab:

4. Against ‘Display the menu for:’, click on All Files.

5. Click OK then Close, and you’re done.

Now all you need to do in KDE is right-click on a file or directory and select Actions > Securely Delete.

The above configuration will only allow you to delete files and directories owned by your user name. However, if you also want to be able to delete files owned by other Linux accounts on your machine then you can modify the command in the KDE Service Menu to prompt you for the root user’s password. To do that, in Step 2 above you would use the following command instead:

kdesu srm -r %u

Now when you right-click on a file or directory, a window will pop up and prompt you to enter the root user’s password.

Of course, if you would prefer to use a different tool to securely delete a file or directory then you could substitute the srm command with e.g. wipe or bcwipe if you have those installed. Use man wipe and man bcwipe after installing them, to check which options you might want to use.

Note that some of your data might be in a temporary (deleted) copy of the file somewhere on the disk. If you installed the secure-delete package then you could use the sfill command to wipe free disk space on any mounted partition, but you would need to be root user to use it. Note also that, if a small file has already acquired a block with your data, no tool can remove that data. Anyway, if you also want to securely wipe any free disk space you can modify the aforementioned command in the KDE Service Menu even further:

kdesu srm -r %u && kdesu sfill directory/mountpoint

I have my /home directory on its own partition, so, in my case the KDE Service Menu entry would be:

kdesu srm -r %u && kdesu sfill /home

This would pop up a window twice prompting you to enter the root user’s password: once for the srm command, and once for the sfill command. Note that the sfill command can take a very, very long time to wipe the free space if it is large (I personally don’t bother using it, as I don’t want my hard disk thrashing for hours). The sfill command works by creating one big file to fill all the free space, then writes to that file using several steps to ensure all the previously-free areas of the disk have had their original contents erased. Once that is completed, the utility then removes the big file, releasing the free disk space.

If you think your swap space contains some of your data, you could use the sswap command — also available if you install the secure-delete package — for secure deletion of the swap space, but you would need to disable your swap space first. I have 4 GB of RAM and my swap partition is virtually never used, so I don’t bother putting my tinfoil hat on in the case of swap either.

Toggle KWin compositing on and off easily from your Desktop

KWin’s Desktop Effects work well and I usually have them enabled, only disabling compositing temporarily while I play a game (I’m a sucker for old arcade games running in GMAMEUI).

One way to enable/disable compositing in KWin 4.7.0 is via System Settings > Desktop Effects > tick/untick ‘Enable desktop effects at startup’ > Apply. This change only takes effect when you restart KDE. A way to toggle compositing on/off is to use a keyboard shortcut. The default keyboard shortcut for this in KWin is Alt-Shift-F12, but KDE on my machine tells me that Qt does not like the use of the Alt key in this shortcut, so I used System Settings > Desktop Effects to change the shortcut to Ctrl+Shift+U, which does toggle compositing on/off.

A toggle icon on the Desktop is another way of achieving the same thing, and is handy if you are using your mouse at the time. Now, a Plasma widget called Toggle-Compositing exists and is a nice way of enabling/disabling compositing at the click of a mouse. However, it has to be compiled — which some users may feel reluctant to do — and it requires the user to know the $KDEDIR, and I’ll wager some users don’t.

Below I describe one way of adding an icon to your Desktop that you can use to toggle compositing in KWin and that does not require any compiling, so it should be more straightforward to implement by a newcomer to KDE.

Use your preferred text editor to create the following Desktop Configuration File named toggle_compositing_in_KWin in your Desktop directory:

[Desktop Entry]
Comment[en_GB]=toggles compositing in KWin
Comment=toggles compositing in KWin
Exec=sh /home/fitzcarraldo/toggle_compositing_in_KWin.sh
GenericName[en_GB]=toggles compositing in KWin
GenericName=toggles compositing in KWin
Icon=kwin
MimeType=
Name[en_GB]=toggle_compositing_in_KWin
Name=toggle_compositing_in_KWin
Path=
StartupNotify=true
Terminal=true
TerminalOptions=
Type=Application
X-DBUS-ServiceName=
X-DBUS-StartupType=none
X-KDE-SubstituteUID=false
X-KDE-Username=

(Replace “fitzcarraldo” with your user name, of course.)

Then create a text file ~/toggle_compositing_in_KWin.sh containing the following:

#!/bin/bash
echo -n "Current compositing state: "
qdbus org.kde.kwin /KWin compositingActive
echo -n "Changing compositing state..."
qdbus org.kde.kwin /KWin toggleCompositing
echo -n "Current compositing state: "
qdbus org.kde.kwin /KWin compositingActive
echo -n "All done. Press ENTER to close window: "
read ENTRY

Finally, open a Konsole window and enter the following command under your own user account:

chmod +x toggle_compositing_in_KWin.sh

And there you have it. You’ll have an icon on your Desktop that looks something like the following:

KWin icon

KWin icon

All you need to do is double-click (or single-click, if you have configured KDE that way) on the icon toggle_compositing_in_KWin on your Desktop and a window will pop-up telling you:

Current compositing state: true
Changing compositing state...
Current compositing state: false
All done. Press ENTER to close window:

To re-enable compositing, just double-click the icon again. And so on.

And now the final touch…

Actually, it’s not necessary to include the last two lines:

echo -n "All done. Press ENTER to close window: "
read ENTRY

in the Bash script above; I just put them in to display the current compositing state. If you omit those two lines then toggling compositing on and off simply becomes a double-click on the icon on the Desktop (or a single click if you have configured KDE that way). In fact, if you also change Terminal=true to Terminal=false and StartupNotify=true to StartupNotify=false in the Desktop Configuration File, then you won’t even see a Konsole window pop-up briefly: compositing will just be toggled on and off seamlessly, so to speak. Just like the keyboard shortcut, only easier to remember!

ExifTool comes to the rescue when I need to fix the date and time in a batch of photo files

Before departing on an overseas trip recently I configured my camera to have the correct date and time at home (BST time zone). Of course I forgot to reconfigure the camera to the local time at my destination. On top of that, for some reason I still do not know, the date in the camera got changed. Anyway, I ended up with a large number of photos with EXIF data containing the wrong date and time. For example, I took one photo on 2011:08:04 at 09:19:03 local time but the EXIF data in the JPEG file was 2011:07:25 02:19:03.

So I needed to find a way to correct the date and time in all the photos in one fell swoop. Enter ExifTool, an excellent command line tool written in Perl. See ExifTool by Phil Harvey for full details and the download page.

To install it, I downloaded Image-ExifTool-8.61.tar.gz and followed the instructions on Installing ExifTool on Unix Platforms.

I’m going to show you how I fixed my photos. There is a lot of console output in this article because I want to give you actual examples of how to use the ExifTool commands, as it took me a while to understand the detailed documentation for the tool.

In order to fix my photos, I first copied into the ExifTool directory the directory containing the photos.

Then I used ExifTool to check the EXIF data in one of the photos, to see which tags needed to be corrected:

fitzcarraldo@meshedgedx ~ $ cd ExifTool/Image-ExifTool-8.61
fitzcarraldo@meshedgedx ~/ExifTool/Image-ExifTool-8.61 $ ./exiftool Photos_04_08_2011/DSC00006.JPG
ExifTool Version Number : 8.61
File Name : DSC00006.JPG
Directory : Photos_04_08_2011
File Size : 1405 kB
File Modification Date/Time : 2011:08:10 09:44:27+01:00 <------- This was the date and time that I last modified this file.
File Permissions : rwxrwxrwx
File Type : JPEG
MIME Type : image/jpeg
Exif Byte Order : Little-endian (Intel, II)
Image Description :
Make : SONY
Camera Model Name : DSC-WX7
Orientation : Horizontal (normal)
X Resolution : 72
Y Resolution : 72
Resolution Unit : inches
Modify Date : 2011:07:25 02:19:03 <------- This is the wrong date and time. It should be 2011:08:04 09:19:03.
Y Cb Cr Positioning : Co-sited
Exposure Time : 1/250
F Number : 8.0
Exposure Program : Landscape
ISO : 100
Sensitivity Type : Recommended Exposure Index
Recommended Exposure Index : 100
Exif Version : 0230
Date/Time Original : 2011:07:25 02:19:03 <------- This is the wrong date and time. It should be 2011:08:04 09:19:03.
Create Date : 2011:07:25 02:19:03 <------- This is the wrong date and time. It should be 2011:08:04 09:19:03.
Components Configuration : Y, Cb, Cr, -
Compressed Bits Per Pixel : 2
Brightness Value : 10.15390625
Exposure Compensation : 0
Max Aperture Value : 2.6
Metering Mode : Multi-segment
Light Source : Unknown
Flash : Auto, Did not fire
Focal Length : 4.5 mm
Panorama Full Width : 0
Panorama Full Height : 0
Panorama Direction : Right to Left
Panorama Crop Left : 0
Panorama Crop Top : 0
Panorama Crop Right : 0
Panorama Crop Bottom : 0
Panorama Frame Width : 0
Panorama Frame Height : 0
Panorama Source Width : 0
Panorama Source Height : 0
Brightness : 0
High ISO Noise Reduction : n/a
HDR : Off
Face Info Offset : 94
Sony Date Time : 2011:07:25 02:19:03 <------- This is the wrong date and time. It should be 2011:08:04 09:19:03.
Faces Detected : 0
Face Info Length : 37
Color Reproduction : Standard
Color Temperature : 4294967295
Color Compensation Filter : -1
Scene Mode : n/a
Zone Matching : ISO Setting Used
Image Stabilization : On
Color Mode : n/a
Macro : Off
Focus Mode : Permanent-AF
AF Mode : Default
AF Illuminator : Auto
Quality : Normal
Flash Level : Unknown (128)
Release Mode : Normal
Sequence Number : Single
Anti-Blur : On (Shooting)
Long Exposure Noise Reduction : Unknown (2)
Dynamic Range Optimizer : Standard
Intelligent Auto : On
White Balance : Auto
User Comment :
Flashpix Version : 0100
Color Space : sRGB
Exif Image Width : 2592
Exif Image Height : 1944
Interoperability Index : R98 - DCF basic file (sRGB)
Interoperability Version : 0100
File Source : Digital Camera
Scene Type : Directly photographed
Custom Rendered : Normal
Exposure Mode : Auto
Digital Zoom Ratio : 1
Scene Capture Type : Landscape
Contrast : Normal
Saturation : Normal
Sharpness : Normal
Lens Info : 4.5-22.5mm f/2.6-6.3
PrintIM Version : 0300
Compression : JPEG (old-style)
Thumbnail Offset : 13588
Thumbnail Length : 8277
MPF Version : 0100
Number Of Images : 2
MP Image Flags : Dependent child image
MP Image Format : JPEG
MP Image Type : Large Thumbnail (full HD equivalent)
MP Image Length : 343933
MP Image Start : 1095165
Dependent Image 1 Entry Number : 0
Dependent Image 2 Entry Number : 0
Image Width : 2592
Image Height : 1944
Encoding Process : Baseline DCT, Huffman coding
Bits Per Sample : 8
Color Components : 3
Y Cb Cr Sub Sampling : YCbCr4:2:2 (2 1)
Aperture : 8.0
Image Size : 2592x1944
Preview Image : (Binary data 343933 bytes, use -b option to extract)
Shutter Speed : 1/250
Thumbnail Image : (Binary data 8277 bytes, use -b option to extract)
Focal Length : 4.5 mm
Light Value : 14.0

I found four tags were incorrect in the file: ‘Modify Date’, ‘Date/Time Original’, ‘Create Date’ and ‘Sony Date Time’. However, before using ExifTool on all four tags and on the whole batch of photos, I first tried fixing only the tag ‘Sony Date Time’ in this single photo, to see if that would work:

fitzcarraldo@meshedgedx ~/ExifTool/Image-ExifTool-8.61 $ ./exiftool "-SonyDateTime+=0:00:10 07:00:0" Photos_04_08_2011/DSC00006.JPG

and then I checked the photo’s meta data again to see if the tag had been changed correctly:

fitzcarraldo@meshedgedx ~/ExifTool/Image-ExifTool-8.61 $ ./exiftool Photos_04_08_2011/DSC00006.JPG
ExifTool Version Number : 8.61
File Name : DSC00006.JPG
Directory : Photos_04_08_2011
File Size : 1405 kB
File Modification Date/Time : 2011:08:10 09:45:16+01:00 <------- This was the date and time when I ran ExifTool to change 'Sony Date Time' in this file.
File Permissions : rwxrwxrwx
File Type : JPEG
MIME Type : image/jpeg
Exif Byte Order : Little-endian (Intel, II)
Image Description :
Make : SONY
Camera Model Name : DSC-WX7
Orientation : Horizontal (normal)
X Resolution : 72
Y Resolution : 72
Resolution Unit : inches
Modify Date : 2011:07:25 02:19:03 <------- Notice it is still wrong, as I didn't try to change it.
Y Cb Cr Positioning : Co-sited
Exposure Time : 1/250
F Number : 8.0
Exposure Program : Landscape
ISO : 100
Sensitivity Type : Recommended Exposure Index
Recommended Exposure Index : 100
Exif Version : 0230
Date/Time Original : 2011:07:25 02:19:03 <------- Notice it is still wrong, as I didn't try to change it.
Create Date : 2011:07:25 02:19:03 <------- Notice it is still wrong, as I didn't try to change it.
Components Configuration : Y, Cb, Cr, -
Compressed Bits Per Pixel : 2
Brightness Value : 10.15390625
Exposure Compensation : 0
Max Aperture Value : 2.6
Metering Mode : Multi-segment
Light Source : Unknown
Flash : Auto, Did not fire
Focal Length : 4.5 mm
Panorama Full Width : 0
Panorama Full Height : 0
Panorama Direction : Right to Left
Panorama Crop Left : 0
Panorama Crop Top : 0
Panorama Crop Right : 0
Panorama Crop Bottom : 0
Panorama Frame Width : 0
Panorama Frame Height : 0
Panorama Source Width : 0
Panorama Source Height : 0
Brightness : 0
High ISO Noise Reduction : n/a
HDR : Off
Face Info Offset : 94
Sony Date Time : 2011:08:04 09:19:03 <------- Notice it is now correct.
Faces Detected : 0
Face Info Length : 37
Color Reproduction : Standard
Color Temperature : 4294967295
Color Compensation Filter : -1
Scene Mode : n/a
Zone Matching : ISO Setting Used
Image Stabilization : On
Color Mode : n/a
Macro : Off
Focus Mode : Permanent-AF
AF Mode : Default
AF Illuminator : Auto
Quality : Normal
Flash Level : Unknown (128)
Release Mode : Normal
Sequence Number : Single
Anti-Blur : On (Shooting)
Long Exposure Noise Reduction : Unknown (2)
Dynamic Range Optimizer : Standard
Intelligent Auto : On
White Balance : Auto
User Comment :
Flashpix Version : 0100
Color Space : sRGB
Exif Image Width : 2592
Exif Image Height : 1944
Interoperability Index : R98 - DCF basic file (sRGB)
Interoperability Version : 0100
File Source : Digital Camera
Scene Type : Directly photographed
Custom Rendered : Normal
Exposure Mode : Auto
Digital Zoom Ratio : 1
Scene Capture Type : Landscape
Contrast : Normal
Saturation : Normal
Sharpness : Normal
Lens Info : 4.5-22.5mm f/2.6-6.3
PrintIM Version : 0300
Compression : JPEG (old-style)
Thumbnail Offset : 13588
Thumbnail Length : 8277
MPF Version : 0100
Number Of Images : 2
MP Image Flags : Dependent child image
MP Image Format : JPEG
MP Image Type : Large Thumbnail (full HD equivalent)
MP Image Length : 343933
MP Image Start : 1095165
Dependent Image 1 Entry Number : 0
Dependent Image 2 Entry Number : 0
Image Width : 2592
Image Height : 1944
Encoding Process : Baseline DCT, Huffman coding
Bits Per Sample : 8
Color Components : 3
Y Cb Cr Sub Sampling : YCbCr4:2:2 (2 1)
Aperture : 8.0
Image Size : 2592x1944
Preview Image : (Binary data 343933 bytes, use -b option to extract)
Shutter Speed : 1/250
Thumbnail Image : (Binary data 8277 bytes, use -b option to extract)
Focal Length : 4.5 mm
Light Value : 14.0

So it looked like ExifTool would do the job. But I was still cautious, so I then used ExifTool to change the tags ‘Modify Date’, ‘Date/Time Original’, ‘Create Date’ and ‘Sony Date Time’ in another photo, just to check they would all be changed correctly, and I doublechecked the dates and times in the EXIF data, this time by using the ExifTool command switches -a -u and -g1 to group the meta data:

fitzcarraldo@meshedgedx ~/ExifTool/Image-ExifTool-8.61 $ ./exiftool -a -u -g1 Photos_04_08_2011/DSC00168.JPG
---- ExifTool ----
ExifTool Version Number : 8.61
---- System ----
File Name : DSC00168.JPG
Directory : .
File Size : 1854 kB
File Modification Date/Time : 2011:08:11 06:30:30+01:00
File Permissions : rwxrwxrwx
---- File ----
File Type : JPEG
MIME Type : image/jpeg
Exif Byte Order : Little-endian (Intel, II)
Image Width : 2592
Image Height : 1944
Encoding Process : Baseline DCT, Huffman coding
Bits Per Sample : 8
Color Components : 3
Y Cb Cr Sub Sampling : YCbCr4:2:2 (2 1)
---- IFD0 ----
Image Description :
Make : SONY
Camera Model Name : DSC-WX7
Orientation : Horizontal (normal)
X Resolution : 72
Y Resolution : 72
Resolution Unit : inches
Modify Date : 2011:08:04 15:30:20 <------- Fixed.
Y Cb Cr Positioning : Co-sited
---- ExifIFD ----
Exposure Time : 1/30
F Number : 2.6
Exposure Program : Program AE
ISO : 400
Sensitivity Type : Recommended Exposure Index
Recommended Exposure Index : 400
Exif Version : 0230
Date/Time Original : 2011:08:04 15:30:20 <------- Fixed.
Create Date : 2011:08:04 15:30:20 <------- Fixed.
Components Configuration : Y, Cb, Cr, -
Compressed Bits Per Pixel : 2
Brightness Value : 1.17734375
Exposure Compensation : 0
Max Aperture Value : 2.6
Metering Mode : Multi-segment
Light Source : Unknown
Flash : Off, Did not fire
Focal Length : 4.5 mm
User Comment :
Flashpix Version : 0100
Color Space : sRGB
Exif Image Width : 2592
Exif Image Height : 1944
File Source : Digital Camera
Scene Type : Directly photographed
Custom Rendered : Normal
Exposure Mode : Auto
White Balance : Auto
Digital Zoom Ratio : 1
Scene Capture Type : Standard
Contrast : Normal
Saturation : Normal
Sharpness : Normal
Lens Info : 4.5-22.5mm f/2.6-6.3
---- Sony ----
Panorama Full Width : 0
Panorama Full Height : 0
Panorama Direction : Right to Left
Panorama Crop Left : 0
Panorama Crop Top : 0
Panorama Crop Right : 0
Panorama Crop Bottom : 0
Panorama Frame Width : 0
Panorama Frame Height : 0
Panorama Source Width : 0
Panorama Source Height : 0
Sony 0x2000 : 0
Sony 0x2002 : 0
Sony 0x2003 : �������������������������������������������������������[...]
Contrast : 0
Saturation : -1
Sharpness : -1
Brightness : 0
Long Exposure Noise Reduction : n/a
High ISO Noise Reduction : n/a
HDR : Off
Sony 0x200c : 0 0 0
Sony 0x200d : 1
Face Info Offset : 94
Sony Date Time : 2011:08:04 15:30:20 <------- Fixed.
Faces Detected : 0
Face Info Length : 37
Color Reproduction : Standard
Color Temperature : 4294967295
Color Compensation Filter : -1
Scene Mode : n/a
Zone Matching : ISO Setting Used
Dynamic Range Optimizer : Standard
Image Stabilization : On
Color Mode : n/a
Macro : Off
Exposure Mode : Program
Focus Mode : Permanent-AF
AF Mode : Default
AF Illuminator : Auto
Sony 0xb045 : 0
Sony 0xb046 : 0
Quality : Normal
Flash Level : Unknown (128)
Release Mode : Normal
Sequence Number : Single
Anti-Blur : On (Shooting)
Sony 0xb04c : 1
Sony 0xb04d : 0
Long Exposure Noise Reduction : Unknown (2)
Dynamic Range Optimizer : Standard
Sony 0xb050 : 2
Sony 0xb051 : 0
Intelligent Auto : On
Sony 0xb053 : 0
White Balance : Auto
Sony 0x9400 : ...........��[...]
Sony 0x9401 : c���....��.����.�D��..�.0b0.L��e�e0E0.L��.[...]
Sony 0x9402 : .l���i.p!�!�����i���V�ie�Pp_��}@i�[...]
Sony 0x9403 : .��.i.��.榚~W��...���[...]
Sony 0x9404 : @�..�.�@}.��.�.0�K��pl.�V���.�..͵�QV..MV[...]
Sony 0x9405 : ..��.���E5�..�..[...]
Sony 0x9406 : �������������������������������������������������������[...]
Sony 0x9407 : �������������������������������������������������������[...]
Sony 0x9408 : .#?A??AA��...�[...]
Sony 0x9409 : .[...]
Sony 0x940a : ��.��[...]
Sony 0x940b : �.�@�@�}�}t}.@�@PpFpNp�p��.�Ҋ_�9�~���v͔� ͸����^�.�[...]
Sony 0x940c : ������[...]
Sony 0x940d : �������������������������������������������������������[...]
Sony 0x940e : �������������������������������������������������������[...]
Sony 0xa100 : [...]
---- InteropIFD ----
Interoperability Index : R98 - DCF basic file (sRGB)
Interoperability Version : 0100
---- PrintIM ----
PrintIM Version : 0300
Print IM 0x0002 : 0x00000001
Print IM 0x0101 : 0x00000001
---- IFD1 ----
Compression : JPEG (old-style)
Image Description :
Make : SONY
Camera Model Name : DSC-WX7
Orientation : Horizontal (normal)
X Resolution : 72
Y Resolution : 72
Resolution Unit : inches
Modify Date : 2011:07:25 08:30:20 <------- Whoops, this one is still incorrect.
Thumbnail Offset : 13588
Thumbnail Length : 12400
Y Cb Cr Positioning : Co-sited
---- MPF0 ----
MPF Version : 0100
Number Of Images : 2
---- MPImage1 ----
MP Image Flags : Representative image, Dependent parent image
MP Image Format : JPEG
MP Image Type : Baseline MP Primary Image
MP Image Length : 1399500
MP Image Start : 0
Dependent Image 1 Entry Number : 2
Dependent Image 2 Entry Number : 0
---- MPImage2 ----
MP Image Flags : Dependent child image
MP Image Format : JPEG
MP Image Type : Large Thumbnail (full HD equivalent)
MP Image Length : 496491
MP Image Start : 1402364
Dependent Image 1 Entry Number : 0
Dependent Image 2 Entry Number : 0
---- Composite ----
Aperture : 2.6
Image Size : 2592x1944
Preview Image : (Binary data 496491 bytes, use -b option to extract)
Shutter Speed : 1/30
Thumbnail Image : (Binary data 12400 bytes, use -b option to extract)
Focal Length : 4.5 mm
Light Value : 5.7

As you can see from the output above, I found another tag that was also incorrect: ‘Modify Date’ in Group IFD1. So I tried to fix that:

fitzcarraldo@meshedgedx ~/ExifTool/Image-ExifTool-8.61 $ ./exiftool "-IFD1:ModifyDate+=0:00:10 07:00:0" Photos_04_08_2011/DSC00168.JPG
1 image files updated

Notice in the command that I prefixed the tag (ModifyDate) with the group (IFD1).

and I checked the photo’s meta data again:

fitzcarraldo@meshedgedx ~/ExifTool/Image-ExifTool-8.61 $ ./exiftool -a -u -g1 Photos_04_08_2011/DSC00168.JPG
---- ExifTool ----
ExifTool Version Number : 8.61
---- System ----
File Name : DSC00168.JPG
Directory : .
File Size : 1854 kB
File Modification Date/Time : 2011:08:11 06:33:50+01:00
File Permissions : rwxrwxrwx
---- File ----
File Type : JPEG
MIME Type : image/jpeg
Exif Byte Order : Little-endian (Intel, II)
Image Width : 2592
Image Height : 1944
Encoding Process : Baseline DCT, Huffman coding
Bits Per Sample : 8
Color Components : 3
Y Cb Cr Sub Sampling : YCbCr4:2:2 (2 1)
---- IFD0 ----
Image Description :
Make : SONY
Camera Model Name : DSC-WX7
Orientation : Horizontal (normal)
X Resolution : 72
Y Resolution : 72
Resolution Unit : inches
Modify Date : 2011:08:04 15:30:20
Y Cb Cr Positioning : Co-sited
---- ExifIFD ----
Exposure Time : 1/30
F Number : 2.6
Exposure Program : Program AE
ISO : 400
Sensitivity Type : Recommended Exposure Index
Recommended Exposure Index : 400
Exif Version : 0230
Date/Time Original : 2011:08:04 15:30:20
Create Date : 2011:08:04 15:30:20
Components Configuration : Y, Cb, Cr, -
Compressed Bits Per Pixel : 2
Brightness Value : 1.17734375
Exposure Compensation : 0
Max Aperture Value : 2.6
Metering Mode : Multi-segment
Light Source : Unknown
Flash : Off, Did not fire
Focal Length : 4.5 mm
User Comment :
Flashpix Version : 0100
Color Space : sRGB
Exif Image Width : 2592
Exif Image Height : 1944
File Source : Digital Camera
Scene Type : Directly photographed
Custom Rendered : Normal
Exposure Mode : Auto
White Balance : Auto
Digital Zoom Ratio : 1
Scene Capture Type : Standard
Contrast : Normal
Saturation : Normal
Sharpness : Normal
Lens Info : 4.5-22.5mm f/2.6-6.3
---- Sony ----
Panorama Full Width : 0
Panorama Full Height : 0
Panorama Direction : Right to Left
Panorama Crop Left : 0
Panorama Crop Top : 0
Panorama Crop Right : 0
Panorama Crop Bottom : 0
Panorama Frame Width : 0
Panorama Frame Height : 0
Panorama Source Width : 0
Panorama Source Height : 0
Sony 0x2000 : 0
Sony 0x2002 : 0
Sony 0x2003 : �������������������������������������������������������[...]
Contrast : 0
Saturation : -1
Sharpness : -1
Brightness : 0
Long Exposure Noise Reduction : n/a
High ISO Noise Reduction : n/a
HDR : Off
Sony 0x200c : 0 0 0
Sony 0x200d : 1
Face Info Offset : 94
Sony Date Time : 2011:08:04 15:30:20
Faces Detected : 0
Face Info Length : 37
Color Reproduction : Standard
Color Temperature : 4294967295
Color Compensation Filter : -1
Scene Mode : n/a
Zone Matching : ISO Setting Used
Dynamic Range Optimizer : Standard
Image Stabilization : On
Color Mode : n/a
Macro : Off
Exposure Mode : Program
Focus Mode : Permanent-AF
AF Mode : Default
AF Illuminator : Auto
Sony 0xb045 : 0
Sony 0xb046 : 0
Quality : Normal
Flash Level : Unknown (128)
Release Mode : Normal
Sequence Number : Single
Anti-Blur : On (Shooting)
Sony 0xb04c : 1
Sony 0xb04d : 0
Long Exposure Noise Reduction : Unknown (2)
Dynamic Range Optimizer : Standard
Sony 0xb050 : 2
Sony 0xb051 : 0
Intelligent Auto : On
Sony 0xb053 : 0
White Balance : Auto
Sony 0x9400 : ...........��[...]
Sony 0x9401 : c���....��.����.�D��..�.0b0.L��e�e0E0.L��.[...]
Sony 0x9402 : .l���i.p!�!�����i���V�ie�Pp_��}@i�[...]
Sony 0x9403 : .��.i.��.榚~W��...���[...]
Sony 0x9404 : @�..�.�@}.��.�.0�K��pl.�V���.�..͵�QV..MV[...]
Sony 0x9405 : ..��.���E5�..�..[...]
Sony 0x9406 : �������������������������������������������������������[...]
Sony 0x9407 : �������������������������������������������������������[...]
Sony 0x9408 : .#?A??AA��...�[...]
Sony 0x9409 : .[...]
Sony 0x940a : ��.��[...]
Sony 0x940b : �.�@�@�}�}t}.@�@PpFpNp�p��.�Ҋ_�9�~���v͔� ͸����^�.�[...]
Sony 0x940c : ������[...]
Sony 0x940d : �������������������������������������������������������[...]
Sony 0x940e : �������������������������������������������������������[...]
Sony 0xa100 : [...]
---- InteropIFD ----
Interoperability Index : R98 - DCF basic file (sRGB)
Interoperability Version : 0100
---- PrintIM ----
PrintIM Version : 0300
Print IM 0x0002 : 0x00000001
Print IM 0x0101 : 0x00000001
---- IFD1 ----
Compression : JPEG (old-style)
Image Description :
Make : SONY
Camera Model Name : DSC-WX7
Orientation : Horizontal (normal)
X Resolution : 72
Y Resolution : 72
Resolution Unit : inches
Modify Date : 2011:08:04 15:30:20 <------- Notice it is now correct.
Thumbnail Offset : 13588
Thumbnail Length : 12400
Y Cb Cr Positioning : Co-sited
---- MPF0 ----
MPF Version : 0100
Number Of Images : 2
---- MPImage1 ----
MP Image Flags : Representative image, Dependent parent image
MP Image Format : JPEG
MP Image Type : Baseline MP Primary Image
MP Image Length : 1399500
MP Image Start : 0
Dependent Image 1 Entry Number : 2
Dependent Image 2 Entry Number : 0
---- MPImage2 ----
MP Image Flags : Dependent child image
MP Image Format : JPEG
MP Image Type : Large Thumbnail (full HD equivalent)
MP Image Length : 496491
MP Image Start : 1402364
Dependent Image 1 Entry Number : 0
Dependent Image 2 Entry Number : 0
---- Composite ----
Aperture : 2.6
Image Size : 2592x1944
Preview Image : (Binary data 496491 bytes, use -b option to extract)
Shutter Speed : 1/30
Thumbnail Image : (Binary data 12400 bytes, use -b option to extract)
Focal Length : 4.5 mm
Light Value : 5.7

Now I was confident that I could fix all the incorrect tags, so I again copied the directory containing the original files into the ExifTool directory and used the commands below to change the date and time from e.g. 2011:07:25 02:19:03 to 2011:08:04 09:19:03, i.e. I wanted to: a) add 7 hours to the EXIF times to make them correct for the city I was in instead of UK BST; b) add 10 days to the EXIF dates to fix the incorrect date (2011:07:25) that was set in my camera to the correct date (2011:08:04).

$ cd ~/ExifTool/Image-ExifTool-8.61
$ ./exiftool "-SonyDateTime+=0:00:10 07:00:0" Photos_04_08_2011/
$ ./exiftool "-DateTimeOriginal+=0:00:10 07:00:0" Photos_04_08_2011/
$ ./exiftool "-CreateDate+=0:00:10 07:00:0" Photos_04_08_2011/
$ ./exiftool "-IFD0:ModifyDate+=0:00:10 07:00:0" Photos_04_08_2011/
$ ./exiftool "-IFD1:ModifyDate+=0:00:10 07:00:0" Photos_04_08_2011/

Finally, as ExifTool automatically creates a back up file before changing EXIF data in a photo file, I deleted the back up files after I had checked that the EXIF data in the new files contained the correct dates and times:

$ rm ./Photos_04_08_2011/*_original

Yet another great tool to add to my toolbox.

Editing from a Linux PC the phone book (contacts list) in an Android phone

A mobile phone stores contacts in the phone itself and/or on the SIM. Over the years, the phone book on my SIM became cluttered with duplicate entries, inconsistently-named contacts, and so on. I decided recently to tidy up the phone book, and looked for a way to do it from Linux.

Now, the last time I tidied up my phone book was back in 2003 when my SIM was in a Sony Ericsson T68i. These days I’m using the same SIM in an Android smartphone: the HTC Desire. Back then I used a shareware application called Mobile Navigator on a laptop running Windows XP. So, naturally, I thought it would be possible to do something similar from a PC running Linux.

An indirect method of editing a phone book in an Android phone is recommended in many Web forums. The advice is to synchronise the phone’s phone book with GMail on your PC, edit the contacts in GMail on the PC and then the contacts will be updated in the phone when the phone next synchronises with GMail. That is all very well, but I don’t want to import my phone contacts into GMail and thus have them stored in ‘The Cloud’, plus I don’t see why I should be forced to do that just to make it easier for me to tidy a phone book in my phone. So I set about searching for an application to do the job.

My search turned up three applications that appeared to enable a user to edit the phone book (phone and SIM):

1. Gammu (CLI) and Wammu (GUI front-end), FOSS with versions for both Linux and Windows.

2. MOBILedit!, a closed-source commercial product for Windows.

3. MyPhoneExplorer (Version 1.8.1), closed-source ‘donationware’ for Windows, recommended in various forums and that has been used with WINE in Linux. Not only does MyPhoneExplorer allow you to edit the phone book, it also provides a host of other features such as: viewing the phone’s call logs, messages, hardware status, files and applications; sending messages via the PC; etc. It’s a nifty application.

Web browsing told me that Gammu/Wammu does not yet work with the HTC Desire (see the bug report Don’t get any connection to HTC Desire via bluetooth in Wammu/Gammu). This is a pity, as Wammu and Gammu look well-designed, and Wammu has a professional feel to it.

The price for MOBILedit! is not extortionate but I wanted to find a cost-free solution if possible, and, more importantly, I could find no evidence on the Web of MOBILedit! having been used with WINE in Linux to edit the phone books in the HTC Desire.

The MyPhoneExplorer forums include a thread on using it with WINE, so MyPhoneExplorer looked like my only option (although it is a pity it is not FOSS). I installed MyPhoneExplorer with its own WINEPREFIX but, despite following the instructions in the MyPhoneExplorer forums, I was unable to get MyPhoneExplorer to connect to the HTC Desire via a USB cable in Linux. This may be because, despite what I have read on the android developers Web site (see Using Hardware Devices and OEM USB Drivers), as is the case with Windows it is necessary in Linux to install ADB USB drivers (the ADB drivers can be installed in Linux by installing the Android SDK). However, I was able to connect MyPhoneExplorer to my HTC Desire via WiFi at home (but not in a hotel, as connection depends on the router and internal network IP address space), and via Bluetooth (anywhere).

How to install MyPhoneExplorer in WINE

1. Use the Android Market to install MyPhoneExplorer Client on the phone.

2. Surf over to the MyPhoneExplorer Home Page and download MyPhoneExplorer_Setup_1.8.1.exe to ~/Desktop/

3. Open a Konsole/Terminal window and perform all the following steps in the same window.

4. Install MyPhoneExplorer on your PC under WINE:

$ cd
$ export WINEPREFIX=$HOME/.wine-myphoneexplorer
$ export WINEARCH="win32"
$ winecfg
$ wget "http://download.microsoft.com/download/5/a/d/5ad868a0-8ecd-4bb0-a882-fe53eb7ef348/VB6.0-KB290887-X86.exe"
$ wine VB6.0-KB290887-X86.exe
$ cd ./.wine-myphoneexplorer/drive_c/
$ cp $HOME/Desktop/MyPhoneExplorer_Setup_1.8.1.exe .
$ mv ${WINEPREFIX}/drive_c/windows/system32/oleaut32.dll ${WINEPREFIX}/drive_c/windows/system32/oleaut32-alt.dll
$ mv ${WINEPREFIX}/drive_c/windows/system32/olepro32.dll ${WINEPREFIX}/drive_c/windows/system32/olepro32-alt.dll
$ echo -e REGEDIT4\\n\\n[HKEY_CURRENT_USER\\Software\\Wine\\DllOverrides]\\n\"asycfilt\"=\"native\"\\n\"comcat\"=\"native\"\\n\"msvbvm60\"=\"native\"\\n\"oleaut32\"=\"native\"\\n\"oleaut32\"=\"native\"\\n\"olepro32\"=\"native\"\\n\"stdole2.tlb\"=\"native\"\\n[HKEY_CURRENT_USER\\Software\\MyPhoneExplorer]\\n\"Language\"=\"English.lng\" > temp.reg
$ wine regedit temp.reg
$ wget http://www.kegel.com/wine/winetricks
$ chmod +x winetricks
$ ./winetricks # Install Visual Basic 6 SP6 (I had to do this as well as wine VB6.0-KB290887-X86.exe)
$ ./winetricks # Install msxml3
$ wine MyPhoneExplorer_Setup_1.8.1.exe # Install MyPhoneExplorer

(Make sure you select the WINEPREFIX first when using winetricks)

5. Edit your Desktop Environment’s menu to use the following command for launching MyPhoneExplorer:

env WINEPREFIX="/home/fitzcaraldo/.wine-myphoneexplorer" WINEARCH="win32" wine C:\\windows\\command\\start.exe /Unix /home/fitzcarraldo/.wine-myphoneexplorer/dosdevices/c:/users/Public/Start\ Menu/Programs/MyPhoneExplorer/MyPhoneExplorer.lnk

(Of course replace “fitzcarraldo” with your user name.)

How to connect via Bluetooth

1. Look up the phone’s Bluetooth MAC address in the phone itself, write it down and keep it to hand. (I use the MAC address 11:22:33:AA:BB:C1 in the examples below.)

2. Enable Blutooth on your PC and phone, make them both discoverable, and pair them.

3. Launch MyPhoneExplorer Client on the phone and wait a few seconds for it to load and run.

4. Now check which channel is used by MyPhoneExplorer Client (In the example below it is Channel 17):

$ sudo sdptool browse
Inquiring ...
Browsing 11:22:33:AA:BB:C1 ...
Service RecHandle: 0x10000
Service Class ID List:
"PnP Information" (0x1200)

Service Name: Headset Gateway
Service RecHandle: 0x10001
Service Class ID List:
"Headset Audio Gateway" (0x1112)
"Generic Audio" (0x1203)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 1
Profile Descriptor List:
"Headset" (0x1108)
Version: 0x0100

Service Name: Handsfree Gateway
Service RecHandle: 0x10002
Service Class ID List:
"Handsfree Audio Gateway" (0x111f)
"Generic Audio" (0x1203)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 2
Profile Descriptor List:
"Handsfree" (0x111e)
Version: 0x0105

Service Name: Object Push
Service RecHandle: 0x10003
Service Class ID List:
"OBEX Object Push" (0x1105)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 3
"OBEX" (0x0008)
Profile Descriptor List:
"OBEX Object Push" (0x1105)
Version: 0x0100

Service RecHandle: 0x10004
Service Class ID List:
"AV Remote Target" (0x110c)
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 23
"AVCTP" (0x0017)
uint16: 0x100
Profile Descriptor List:
"AV Remote" (0x110e)
Version: 0x0100

Service Name: BRCM Advanced Audio
Service RecHandle: 0x10005
Service Class ID List:
"Audio Source" (0x110a)
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 25
"AVDTP" (0x0019)
uint16: 0x102
Profile Descriptor List:
"Advanced Audio" (0x110d)
Version: 0x0102

Service Name: Phonebook Access PSE
Service RecHandle: 0x10006
Service Class ID List:
"Phonebook Access - PSE" (0x112f)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 4
"OBEX" (0x0008)
Profile Descriptor List:
"Phonebook Access" (0x1130)
Version: 0x0100

Service Name: OBEX File Transfer
Service RecHandle: 0x10007
Service Class ID List:
"OBEX File Transfer" (0x1106)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 5
"OBEX" (0x0008)
Profile Descriptor List:
"OBEX File Transfer" (0x1106)
Version: 0x0100

Service Name: MyPhoneExplorer
Service RecHandle: 0x10008
Service Class ID List:
UUID 128: 00001101-0000-1000-7000-00304b7f34de
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 17

5. Bind a virtual serial device to the phone (You can look up the phone’s Bluetooth MAC address in the phone itself to double check):

$ sudo rfcomm bind 1 11:22:33:AA:BB:C1 17

N.B. If you have been tinkering already with binding, and the virtual device /dev/rfcomm1 is therefore already bound, you will get an error message saying “Can’t create device: Address already in use”. You can release the virtual device by using the command:

$ sudo rfcomm release /dev/rfcomm1

6. Create a symbolic link for the virtual serial link:

$ export WINEPREFIX=$HOME/.wine-myphoneexplorer
$ sudo ln -is /dev/rfcomm1 ${WINEPREFIX}/dosdevices/com2
$ sudo chmod 777 ${WINEPREFIX}/dosdevices/com2 # you may not need to do this, as the permissions may already be 777.

7. Launch MyPhoneExplorer (e.g. in KDE this would be: Kickoff > Applications > Wine> Programs > MyPhoneExplorer > MyPhoneExplorer), then press F2 (or select File > Settings).

8. Select ‘Connection’ in the left pane and then select ‘Phone type’ to be ‘SonyEricsson phone with modeminterface’. Tick ‘Stable connection (some features are deactivated)’.

9. Select ‘Connection’ in the left pane and then select ‘Phone type’ to be ‘Phone with Google Android-OS’.

10. Select ‘Connection’ in the left pane and then select ‘Connect via…’ to be ‘Bluetooth’ and enter “COM2″ (upper case, and without the quotes) and click on ‘OK’.

11. Press F1 (or select File > Connect) and your PC should be able to connect to the phone and synchronise with your phone’s phone book (Extras > Start Multi-sync), thus enabling you to edit the contents and re-synchronise to update the phone book in the phone.

Script to make subsequent connections via Bluetooth easier

Note that the channel used by MyPhoneExplorer Client will change the next time you want to connect, so there is no point editing /etc/bluetooth/rfcomm.conf (the Linux configuration file in which you would normally specify the channel). Therefore, to make life a little easier, I wrote a simple Bash script to automate as much as possible the process of reconnecting via Bluetooth in future. If you want to do the same, use your favourite text editor and save the following script with the file name myphoneexplorer.sh:

#!/bin/bash
echo -n "Please switch on Bluetooth via System Tray icon, make Bluetooth discoverable then press ENTER: "
read RESPONSE
echo -n "Please enable Bluetooth on the phone, make it discoverable then press ENTER: "
read RESPONSE
export WINEPREFIX="/home/fitzcarraldo/.wine-myphoneexplorer"
export WINEARCH="win32"
echo "Checking current rfcomm status..."
sudo rfcomm -a
echo "Trying to release rfcomm1 in case it is in use (no message means rfcomm1 is released and is now OK to use,"
echo "and the message Cannot release device: No such device also means rfcomm1 is OK to use)..."
sudo rfcomm release /dev/rfcomm1
echo -n "Now please launch MyPhoneExplorer Client on the phone, wait a few seconds then press ENTER: "
read RESPONSE
echo "Find channel of MyPhoneExplorer Client:"
sudo sdptool browse
echo -n "Enter the channel number: "
read RESPONSE
sudo rfcomm bind 1 11:22:33:AA:BB:C1 $RESPONSE
echo "Checking current rfcomm status..."
sudo rfcomm -a
echo "If all is OK then please launch MyPhoneExplorer from Kickoff > Applications > Wine > Programs > MyPhoneExplorer"
echo "and press F1 to connect to the phone."

(Of course replace “fitzcarraldo” with your user name, and replace “11:22:33:AA:BB:C1″ with the Bluetooth MAC address of your phone.)

Then make the script executable:

$ chmod +x myphoneexplorer.sh

The next time you want to use MyPhoneExplorer, open a Konsole/Terminal, execute the script:

$ sh myphoneexplorer.sh

and follow the instructions it displays in the Konsole/Terminal window.

How to connect via WiFi

Connecting MyPhoneExplorer to the phone via WiFi is easier than via Bluetooth. Note that WiFi connection will not work with a public WiFi network, just a home WiFi network.

1. Enable WiFi on your PC and phone.

2. Launch MyPhoneExplorer Client on the phone and wait a few seconds for it to load and run.

3. Launch MyPhoneExplorer (e.g. in KDE this would be: Kickoff > Applications > Wine> Programs > MyPhoneExplorer > MyPhoneExplorer), then press F2 (or select File > Settings).

4. Select ‘Connection’ in the left pane and then select ‘Phone type’ to be ‘SonyEricsson phone with modeminterface’. Tick ‘Stable connection (some features are deactivated)’.

5. Select ‘Connection’ in the left pane and then select ‘Phone type’ to be ‘Phone with Google Android-OS’.

6. Select ‘Connection’ in the left pane and then select ‘Connect via…’ to be ‘WiFi’ and click on ‘OK’.

7. Press F1 (or select File > Connect) and your PC should be able to connect to the phone and synchronise with your phone’s phone book (Extras > Start Multi-sync), thus enabling you to edit the contents and re-synchronise to update the phone book in the phone.

Useful references

The MyPhoneExplorer forums are oriented to Windows as it is a Windows application, but there is a thread for Linux users: HowTo: Use MyPhoneExplorer under GNU/Linux (English Version)

The thread for Windows users of MyPhoneExplorer may also be of some use: Howto and FAQ: Use Android Phones with MyPhoneExplorer

Limitations in WINE

The only limitation I have found using MyPhoneExplorer 1.8.1 in WINE is that it crashes if I try to cut and paste when editing a phone book entry. Additionally, some people have reported that the buttons on the button bar do not work when you are connected to the phone; they usually do work for me (apparently it depends on whether you have installed msxml3) but sometimes don’t. In any case, if they don’t then you can use the pull-down menus from the menu bar instead.

Other than that, MyPhoneExplorer works well in WINE and enables me to edit the phone book in my Android phone without involving Big Brother! It’s a nice application.

Firewall rules if using WiFi

If you’re using MyPhoneExplorer to connect with the phone via WiFi instead of Bluetooth, and your PC has a firewall enabled, according to a post on 7 June 2011 in the MyPhoneExplorer forums you have to configure the firewall with the following rules:

TCP port 80 (outgoing) – Check for update
TCP port 5210 (outgoing) – Communication with client
UDP port 5211 (outgoing) – Communication with client
UDP port 5212 (inbound) – Broadcast from the client

Below I list the rules I implemented in Uncomplicated Firewall:

# ufw status
Status: active

To              Action          From
--              ------          ----
Anywhere        ALLOW           5212/udp

80/tcp          ALLOW OUT       Anywhere
5210/tcp        ALLOW OUT       Anywhere
5211/udp        ALLOW OUT       Anywhere

Alternatively you could just disable the firewall on your PC while you’re using MyPhoneExplorer with your phone, which I do anyway when I’m at home as my home network is protected by the firewall in my router.

EDIT (October 25, 2012): Now there is another way of editing an Android phone’s contacts list from Linux: AirDroid. And you don’t need to mess around with WINE to use it. For details see my post AirDroid, a handy Android app for managing your phone from Linux.

Follow

Get every new post delivered to your Inbox.

Join 25 other followers