A guided tour of my KDE 4.8.4 desktop (Part 1)

I have used GNOME, LXDE, Xfce and others, but KDE is my favourite desktop environment and I’ve used every release since 3.5.2. Although there are a few things that still need improving, by and large I find KDE to be an excellent desktop environment with every feature and facility I need, and highly configurable. It is the only desktop environment I choose to use professionally (I virtually never have to touch Windows at work, although I can dual boot Windows 7 on my laptop just in case I come across an application that only runs in Windows), and it is the main Linux desktop environment I use at home, although from time to time at home I use Xfce on another laptop, Android 3.2 on my Motorola Xoom tablet and Windows Vista on the family PC. I can honestly say that Windows Vista and Windows 7 feel clunky and old fashioned to me after using KDE, not to mention less easy on the eye.

All but one of my work colleagues use Windows or Mac OS X, and they notice the KDE desktop on my laptop and ask questions about it. So I thought I’d provide a guided tour of the KDE desktop on my laptop, as it might be of interest to newcomers to Linux or to Linux users contemplating trying KDE. There is too much to show in one or even two articles, but I thought I’d at least cover some of the main features in a couple of articles. So here is the first installment…

KDM greeter screen

The KDM Greeter screen (log-in screen) is the first KDE screen to appear, and it follows the framebuffer console decoration (‘bootsplash’) displayed after I select Linux from the GRUB 2 bootloader menu. I chose a simple KDM log-in screen called gentoo-linux-kde that I downloaded from the openDesktop.org Web site.

KDM Greeter screen

Snapshot 1 - KDM Greeter screen

Incidentally, if you’re wondering how I made a snapshot of the KDM log-in screen, I used a tip by Todd Partridge and added the following command to the file /usr/share/config/kdm/Xsetup and restarted my machine:

sleep 10 && import -window root /tmp/kdm.png &

KDE Splash Screen

The KSplash screen is displayed briefly after log-in. I chose the Air and Ariya Splash Screen, one of the splash screens that comes with KDE 4.8.4 and is selected via System Settings > Workspace Appearance.

KDE Splash Screen

Snapshot 2 - KDE Splash Screen

If you’re wondering how I made that screenshot, System Settings > Workspace Appearance has a ‘Test Theme’ button. I just clicked on that and pressed the Prt Sc key on my keyboard to capture it with the KSnapshot utility, which I had previously linked to the Prt Sc key by using System Settings > Shortcuts and Gestures.

My desktop

The five icons on KSplash pop up one by one and the KDE desktop itself then appears. I’m using the Air desktop theme with Oxygen windows decorations, Oxygen icon set, Oxygen Black cursor theme, Oxygen widget style and DejaVu Sans 8 fonts.

KDE desktop

Snapshot 3 - KDE desktop

I tend to change the wallpaper quite often, but the rest has been the same for I can’t remember how long. This wallpaper is a poster image of beautiful Chinese actress Ziyi Zhang (who doesn’t really have blue eyes) in Memoirs of a Geisha.

In KDE the number of Panels (‘task bars’, in Windows parlance) and their dimensions and position are up to the user, but I prefer to have only one Panel, and I prefer it to be situated at the bottom of the desktop. I suppose I’m traditional that way.

Everything you see on my desktop is a KDE Plasmoid (also known as a ‘Plasma widget’), and there are many KDE widgets to chose from, both bundled with KDE and available for download from the Web. Some excellent widgets have been developed by individuals who have nothing to do with the KDE development team. The positioning of widgets, be it on the desktop itself or on the Panel, is entirely up to the user. In fact, there is nothing stopping you from having mutliple instances of the same widget. For example you could have two instances of the Comic Strip widget, each showing a different comic strip.

The only widgets I want on the desktop itself are, clockwise from top left:

Folder View

I use the Folder View widget to view the icons in my ~/Desktop directory. This is perhaps one of the most confusing concepts for Windows users to grasp, and also confused a lot of KDE 3 users (me included). On a traditional desktop the user can place icons for applications, directories (folders), files and shortcuts. In KDE 4, if you wish, the icons in the ~/Desktop directory can be shown in a Folder View widget on the desktop instead of on the desktop itself. Initially I preferred the traditional way, but I finally came to like using a Folder View widget to show the contents of my ~/Desktop directory on my desktop. The width and height of a Folder View widget are user-configurable, so I can keep it out of the way of the wallpaper image yet still easily access my most commonly used applications, scripts, directories and files. The widget automatically adds scroll bars when you resize it.

Folder View widget

Snapshot 4 - Folder View widget

Folder View widget showing tooltip

Snapshot 5 - Folder View widget showing tooltip

By the way, you can see above that I have Microsoft Office 2007 installed on my machine. It runs under WINE (see my earlier article WINE tips: Giving each Windows application its own environment for how I installed Office 2007). I use LibreOffice too, but have found that Office 2007 does some things better. Those three Office 2007 icons in my ~/Desktop directory launch Bash scripts that set up the WINEPREFIX and WINEARCH environment variables and issue the WINE command to launch the relevant Office 2007 application.

Folder View also allows the user to preview the contents of directories and sub-directories, so you can drill down very quickly into nested directories without clicking.

Folder View widget viewing directory contents

Snapshot 6 - Folder View widget viewing directory contents

Note that you can have as many Folder View widgets as you want on your desktop, and they can be used to view any directory, not just the ~/Desktop directory.

Hardware Temperature

This widget displays the current reading of the two ACPI temperature sensors in my laptop, both as trend graphs and on dashboard-type dials.

Network Monitor

This widget displays trend graphs of throughput in KiB/s for network interfaces specified by the user. I choose to display both wired (eth0) and wireless (wlan0) network graphs.

yaWP

yaWP is an excellent weather widget with a lot of options. It is easily configurable for multiple locations, which is handy for my frequent travels.

My Panel

The widgets I added to the left end of my Panel are Lancelot Launcher, Takeoff Launcher, Pager (the four rectangles; more about that later) and Dictionary. The widgets I added to the right end of my Panel are: System Tray, Digital Clock and Wastebin. With the exception of Wastebin, all the icons shown on the right side of the Panel are inside the System Tray widget. Additionally, I placed the Icon-Only Task Manager widget in the middle of the Panel, to display an icon for each running application (file manager, browser, and so on), be it maximised or minimised.

An application launcher is a common feature of any Desktop Environment, and a number of launchers are available for KDE. The standard launcher is Kickoff, which originated in openSUSE. Naturally it is also a widget and, as with any widget, can be placed anywhere on the Panel or on the desktop itself (or both, if you feel like it!). Although I find the Kickoff launcher good, I prefer another launcher: Lancelot. I placed the Lancelot widget on the left side of the Panel, and configured it to use the Genxigen KDE menu icon. A click on the icon reveals Lancelot’s intuitive menu:

Lancelot Launcher

Snapshot 7 - Lancelot Launcher

The three System Actions buttons along the bottom of the Lancelot launcher pane are configurable. I have configured them to be Lock Session, Leave and Switch User. Clicking on Leave displays a menu with buttons Log Out, Reboot, Shut Down, Suspend to Disk and Suspend to RAM. A nice feature is that you can configure KDE to display a sub-menu for Reboot that allows you to specify which of the entries in your GRUB 2 bootloader menu you wish to boot (see GRUB2/BURG Integration in KDE).

I used to have more widgets and icons on my Panel, to enable me to quickly launch the applications I use most frequently (Firefox, Konqueror, Thunderbird, Dolphin, KCharSelect, KWrite, KCalc and so on). However, the icons took up space on the Panel and reduced the space available to the Icon-Only Task Manager for displaying the icons of running applications. So I added a second launcher widget on my Panel: Takeoff Launcher, the icon next to the Lancelot widget’s icon. I downloaded a crisp SVG Gentoo icon to use as that launcher’s icon on the Panel. Takeoff Launcher is a full-blown launcher, but I only use its Favourites pane, to launch my most frequently used applications.

Takeoff Launcher

Snapshot 8 - Takeoff Launcher

Lancelot also has a Favourites pane, but Takeoff is easy to configure to have a large pane with big, widely-spaced icons, and it is therefore good for quickly launching my most-used applications. So the only application I have left on the Panel is the KDE dictionary widget:

Dictionary widget on my Panel

Snapshot 9 - Dictionary widget on my Panel

System Tray

System Tray on my Panel

Snapshot 10 - System Tray on my Panel

The System Tray widget is the ‘notification area’ and holds a number of applets and widgets. The KDE icons for Clipboard, Volume, Device Notifer, Network Management, Printer Applet, Notifications, KOrganizer Reminder daemon, Desktop Search File Indexing and Battery Monitor (some of which are themselves widgets) are monochrome. I don’t think it is a coincidence that they were made monochrome after Microsoft changed to monochrome icons in the notification area of Windows 7. I wish I could change those KDE icons, as I prefer coloured notification icons in a System Tray: I find coloured icons quicker to recognise and I also prefer coloured icons from an aesthetic point of view. The coloured icons you can see in my System Tray are, from left to right, Compiz Fusion Icon, Easystroke, AutoKey, BasKet Note Pads, KAlarm and Keyboard Layout (clicking on the flag allows me to switch to other keyboard layouts, each with its own flag). One of these days I’ll get rid of the Compiz Fusion Icon, as I rarely use Compiz anymore because KWin Desktop Effects are now a match for Compiz in most areas.

EDIT (July 16, 2012): I have just discovered that there is a way to change the System Tray icons: see How to Use Custom Tray Icons in KDE.

Notifications applet pop-up messages can be disabled, but I prefer to leave them enabled as they come in handy when I’m sending photos from my phone to my laptop via Bluetooth. Here is what a pop-up from the Notifications applet looks like when Yakuake is launched at start up:

Notifications applet

Snapshot 11 - Notifications widget

By the way, Yakuake is another cool KDE application. Pressing F12 toggles a slide-down/up terminal window:

Yakuake

Snapshot 12 - Yakuake slide-down window

System Settings

The main GUI configuration menu for KDE is System Settings, which I can launch from either launcher. This is used to configure account details, workspace and application appearance, file associations, shortcuts, hardware settings, applications to run at startup, and just about anything else you can think of. I never bother to use System Settings to configure printers, though, as I prefer to use the CUPS Management interface http://localhost:631/ in a browser window.

System Settings main window

Snapshot 13 - System Settings main window

The items in the System Settings menu depend on which KControl modules are installed. For example, I installed the UFW KControl Module (the package kcm-ufw) so there is an entry in System Settings for UFW.

Firewall - System Settings

Snapshot 14 - Firewall - System Settings

One of the other configuration menus in System Settings is Desktop Effects, to configure the 3D and compositing effects that the KWin window manager provides. For screenshots of some of the effects see my earlier article Pimping my Desktop: have KWin Desktop Effects improved in KDE 4.6.2?

UFW KControl Module

Snapshot 15 - Desktop Effects - System Settings

Some people derisively call these effects ‘eye candy’ or ‘wobbly windows’ (the latter being one of the available effects) but I find some of them useful. The Desktop Cube (Ctrl-F11) and windows transparency (Alt + mouse scroll wheel) are two that I often use at work. Being able to place open windows on different faces of the cube, and flip quickly between them either with a mouse click, mouse wheel scroll or keyboard shortcut is handy. And sometimes I need to refer to text in a window underneath the one I’m typing in, and being able to make the latter transparent or semi-transparent quickly just to check something is also handy. Wobbly windows themselves are pure eye candy, but cool nonetheless. I’m so used to wobbly windows that I miss the effect if using another machine without it.

KWin Desktop Cube

Snapshot 16 - KWin Desktop Cube

I have configured the Pager widget to display the four virtual desktops (cube faces) as a row of four rectangles on the Panel, and I can click on any of the four rectangles to rotate the cube to the relevant virtual desktop (cube face). I have also configured the Pager’s keyboard shortcuts so that Ctrl-Alt- and Ctrl-Alt- rotate the cube left and right, respectively (see Switching from Compiz to the KDE Native Composite Engine).

Selecting Plasmoids (widgets)

Adding widgets to a Panel or to the desktop is easy. There is a small Tool Box icon in the top right of the desktop. Because of its shape, this icon is often called ‘the cashew’.

Tool Box ('the cashew')

Snapshot 17 - Tool Box ('the cashew')

You just click on it, select ‘Unlock Widgets’ then ‘Add Widgets’ (right-clicking on the desktop allows you to select ‘Add Widgets’ too), and a scrollable menu bar with widgets appears above the Panel:

Widgets menu

Snapshot 18 - Widgets menu

You can then select the widget you want and drag it to a place on the Panel or on the desktop itself. A ‘Get New Widgets…’ button allows you to search for, select and download other widgets from the Web or to install a new widget from a local file you downloaded earlier.

While ‘Unlock Widgets’ is selected there is also a cashew icon (‘Panel Tool Box’) at the right end of the Panel. If you click on that a menu pops up to allow you to configure the Panel itself (position, length, height, auto-hide, spacers and so on).

Activities

Activities are another unique KDE feature, and probably the least understood and least used of all KDE features. If you select Activities in the cashew menu (see Snapshot 17) or in the Widgets menu (see Snapshot 18), a new menu pops up:

Activities config menu

Snapshot 19 - Activities menu

Apart from my existing ‘Desktop’ activity (my normal environment with its four virtual desktops), I have three template activities titled ‘Search and Launch’, ‘Photos Activity’ and ‘Desktop Icons’. I could delete any or all of those or customise them as I wish (I could also click on the ‘Create Activity’ button to create further activities). For example, if I click on the ‘Photos Activity’ icon, I see the following desktop, which I could go on to customise by adding widgets and wallpaper that are unique to this activity.

an Activity

Snapshot 20 - an Activity

To see a screencast of Activities in action, check out ChaniBlog post Activities in Action. To read more about KDE Activities, see The Mystery of KDE Activities.

To be honest, I’m not particularly interested in using Activities, as I find the traditional virtual desktops in KDE adequate for my purposes. But I can see that Activities might have their uses. You can read some comments on the current state of Activities design, and suggestions to improve it, in the article Nine Ways to Make KDE Activities More Useful.

Docks

Mac OS X has made the dock concept popular, and there are a number of dock widgets specifically for KDE, such as Daisy. Cairo Dock is not specifically designed for KDE but works well in KDE. As you can see from the snapshot below, I installed it. To be honest, though, I never use it, as Lancelot Launcher, Takeoff Launcher, Folder View and the Panel do everything I want and more.

Cairo Dock

Snapshot 21 - Cairo Dock

Desktop Search

‘Desktop Search’ is one of the entries in System Settings. If I double-click on that entry I can then enable or disable Nepomuk Semantic Desktop (tagging and rating of files), Nepomuk File Indexer (searching of files by content instead of just by name) and E-mail Indexing (full text search in e-mails and their attachments).

If I click on the ‘Desktop Search File Indexing’ icon in the System Tray (the icon to the left of the Keyboard Layouts icon in Snapshot 11) then the following window pops-up, telling me the status of file indexing:

Nepomuk

Snapshot 22 - Nepomuk

To give you an example of how I use Desktop Search, I was looking for a MIDI file of The Monkees’ ‘I’m A Believer’ that I saved a long time ago. I can press Alt-F2 to launch KRunner, and enter a search string:

Searching via KRunner

Snapshot 23 - Searching via KRunner

or I can click on the Lancelot Launcher icon and enter the search string there:

Searching via Lancelot

Snapshot 24 - Searching via Lancelot

Either way, clicking on the file they find launches KMid, the KDE MIDI file player:

Searching via Lancelot

Snapshot 25 - KMid

By the way, both KRunner and Lancelot will accept commands as well as file names.

File Managers

Dolphin file manager

Snapshot 26 - Dolphin file manager

Dolphin is the default file manager in KDE. It has a raft of features and is very easy to use. Features have been added to Dolphin in each KDE release, and it is now a powerful file manager. Other KDE file managers I use frequently are Krusader and Konqueror, the latter also a Web browser that I have found will sometimes display Web pages that Firefox cannot (I installed the kwebkitpart package and configured Konqueror to use the WebKit rendering engine by default rather than the KHTML rendering engine). Konqueror is not so popular since the advent of Dolphin, but I use it quite often as it has several strings to its bow.

Konqueror and Dolphin can use KIO Slaves (in Gentoo these are available by installing the packages kdebase-kioslaves, kdemultimedia-kioslaves and kio-sysinfo), which provide additional functionality. One of the KIO Slaves for Konqueror is sysinfo:/, which I have bookmarked to save typing it in the address bar:

Konqueror using sysinfo:/

Snapshot 27 - Konqueror using sysinfo:/

For more detailed system information, I select System > KInfoCenter from the Lancelot menu, or enter the command kinfocenter in KRunner or in the input field of Lancelot or in a terminal window (you are spoilt for choice in Linux!).

Applications and Tools I use

If you’re wondering what I used to capture the images for this article, apart from the ImageMagick import command to capture the KDM Greeter screen, I used KSnapshot:

KSnapshot

Snapshot 28 - KSnapshot


And, after installing the package media-gfx/scrot, I used the following command in a Konsole window to take the above snapshot of the KSnapshot window:

$ scrot -d 6 -b -s snapshot.png

Coming in Part 2…

In my next article I’ll show you a few of the other applications and tools – both KDE and non-KDE – that I use regularly in KDE on my laptop.

Getting the integrated fingerprint reader on my laptop to work in Linux

My Compal NBLB2 laptop has a built-in Upek TCS5B fingerprint scanner:

$ lsusb | grep -i upek
Bus 002 Device 003: ID 147e:1001 Upek

I’m running 64-bit multilib Gentoo Linux with KDE 4.8.1 on this laptop. I decided it was about time I got the built-in fingerprint scanner/sensor working.

The FOSS application Fingerprint GUI caters for this model of fingerprint reader, as well as several other models: see the application’s Home Page (Ref. 1 at the end of this post) for a list of the models supported.

The Gentoo Bugzilla has a bug report (Ref. 2) that I found very helpful (my thanks, in particular, go to Jan Buecken), but the ebuilds in it were not for the latest version of Fingerprint GUI, which is 1.04 as I write this. The required packages are sys-auth/fingerprint-gui and sys-auth/upekbsapi-bin. So I had to modify a little the ebuilds from the Gentoo Bugzilla, and I installed the packages using a Portage local overlay as explained below (/etc/make.conf had already been edited accordingly and /usr/local/portage/profiles/repo_name had already been created).

1. First I created the local overlay directories for the two packages:

# mkdir -p /usr/local/portage/sys-auth/fingerprint-gui
# mkdir -p /usr/local/portage/sys-auth/upekbsapi-bin

2. Then I edited the fingerprint-gui-1.03 ebuild from Ref. 2 to create the file /usr/local/portage/sys-auth/fingerprint-gui/fingerprint-gui-1.04.ebuild containing:

# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=3

inherit qt4-r2 versionator

MAKEOPTS="$MAKEOPTS -j1"

MY_PV=$(replace_version_separator 2 -)
DESCRIPTION="Use Fingerprint Devices with Linux"
HOMEPAGE="http://www.n-view.net/Appliance/fingerprint/"
SRC_URI="http://www.n-view.net/Appliance/fingerprint/download/${PN}-${MY_PV}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64"
IUSE="upekbsapi"

DEPEND=">=sys-auth/libfprint-0.1.0_pre2
|| ( ( x11-libs/qt-core:4 x11-libs/qt-gui ) x11-libs/qt:4 )
>=app-crypt/qca-2.0.0
>=app-crypt/qca-ossl-2.0.0_beta3
x11-libs/libfakekey
>=dev-libs/libusb-1.0.0
sys-auth/polkit-qt
sys-libs/pam
!sys-auth/pam_fprint
!sys-auth/fprintd
!sys-auth/thinkfinger
"
RDEPEND="${DEPEND}
upekbsapi? ( sys-auth/upekbsapi-bin[headers] )"

S=${WORKDIR}/${PN}-${MY_PV}

src_configure() {
if has_version '>=sys-auth/polkit-qt-0.99.0'; then
eqmake4 LIBPOLKIT_QT=LIBPOLKIT_QT_1_1 || die "qmake4 failed"
else
eqmake4 || die "qmake4 failed"
fi
}

src_install() {
emake INSTALL_ROOT="${D}" DESTDIR="${D}" install || die "emake install failed"

domenu bin/fingerprint-gui/fingerprint-gui.desktop

dodoc CHANGELOG README COPYING\
doc/*.html\
doc/*.png
}

pkg_postinst() {
elog "1) Please see /usr/share/doc/${P}/Install-step-by-step.html to configure your device."
elog "   A fast (not recommended) way to use fingerprint-gui with your pam based application"
elog "   you can add the following line to the first off /etc/pam.d/system-auth"
elog "   auth        sufficient  pam_fingerprint-gui.so"
elog "   For more security we recommend that you don't enable fingerprint-gui authentication for all pam services."
elog "   See Install-step-by-step.html again."
elog "2) You must be in the plugdev group to use fingerprint"
if use upekbsapi; then
elog "3) You select to install upeks bsapi library, it's not open-sourced. Use it on your own risk."
fi
}

3. I edited the upekbsapi-bin-3.5.2.ebuild from Ref. 2 to create the file /usr/local/portage/sys-auth/upekbsapi-bin/upekbsapi-bin-3.5.2.ebuild containing:

# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=3

FP_GUI=fingerprint-gui-1.04
MY_PN=${PN/bsapi-bin/}
DESCRIPTION="UPEK Biometric Services SDK for PC"
HOMEPAGE="http://www.upek.com/solutions/eikon/default.asp"
SRC_URI="http://www.n-view.net/Appliance/fingerprint/download/${FP_GUI}.tar.gz"

LICENSE="EULA"
SLOT="0"
KEYWORDS="~x86 ~amd64"
IUSE="-headers"

DEPEND=""
RDEPEND="${DEPEND}"

S=${FP_GUI}/${MY_PN}

src_unpack() {
unpack ${FP_GUI}.tar.gz
}

src_install() {
cd "${S}"/
dodoc Readme.pdf releasenotes.txt UPEK_EULA.pdf
if use headers; then
dodoc doc/BSAPI.pdf  doc/BSAPIUsageonLinux.pdf
insinto /usr/include
doins include/bsapi.h
doins include/bserror.h
doins include/bstypes.h
fi
if use x86; then
dolib lib/libbsapi.so
elif use amd64; then
dolib lib64/libbsapi.so
fi
insinto /etc/udev/rules.d
doins 91-fingerprint-gui-upek.rules
dodir /var/${MY_PN}_data
fperms 777 /var/${MY_PN}_data
echo "nvmprefix=\"/var/${MY_PN}_data/.NVM\" dualswipe=0" > ${MY_PN}.cfg
insinto /etc
doins ${MY_PN}.cfg
}

4. Then I entered the following commands to create manifests for the two packages and to merge (install) them:

# cd /usr/local/portage/sys-auth/upekbsapi-bin
# ebuild upekbsapi-bin-3.5.2.ebuild manifest
# cd /usr/local/portage/sys-auth/fingerprint-gui
# ebuild fingerprint-gui-1.04.ebuild manifest
# USE="headers" emerge -1v upekbsapi-bin
# USE="upekbsapi" emerge -1v fingerprint-gui

5. The file /etc/pam.d/system-auth on my laptop contained the following lines:

auth            required        pam_env.so
auth            required        pam_unix.so try_first_pass likeauth nullok
auth            optional        pam_permit.so

account         required        pam_unix.so
account         optional        pam_permit.so

password        required        pam_cracklib.so difok=2 minlen=8 dcredit=2 ocredit=2 retry=3
password        required        pam_unix.so try_first_pass use_authtok nullok sha512 shadow
password        optional        pam_permit.so

session         required        pam_limits.so
session         required        pam_env.so
session         required        pam_unix.so
session         optional        pam_permit.so

and I edited it to be as follows:

auth            required        pam_env.so
auth            sufficient      pam_fingerprint-gui.so -d try_first_identified
auth            required        pam_unix.so try_first_pass likeauth nullok
auth            optional        pam_permit.so

account         required        pam_unix.so
account         optional        pam_permit.so

password        required        pam_cracklib.so difok=2 minlen=8 dcredit=2 ocredit=2 retry=3
password        required        pam_unix.so try_first_pass use_authtok nullok sha512 shadow
password        optional        pam_permit.so

session         required        pam_limits.so
session         required        pam_env.so
session         required        pam_unix.so
session         optional        pam_permit.so

6. The UPEK fingerprint scanner on my laptop is Device 003 on USB Bus 002:

# lsusb | grep -i upek
Bus 002 Device 003: ID 147e:1001 Upek

As you can see below, the device is correctly a member of the plugdev group:

# ls -la /dev/bus/usb/002
total 0
drwxr-xr-x 2 root root 120 Mar 20 15:31 .
drwxr-xr-x 4 root root 80 Mar 20 15:31 ..
crw-rw-r-- 1 root usb 189, 128 Mar 20 15:31 001
crw-rw-r-- 1 root usb 189, 129 Mar 20 15:31 002
crw-rw-r-- 1 root plugdev 189, 130 Mar 20 17:37 003
crw-rw-r-- 1 root usb 189, 131 Mar 20 15:31 004

and my user account is a member of the plugdev group too:

$ groups
disk lp wheel floppy uucp cron audio cdrom dialout video games cdrw usb users kismet clamav haldaemon plugdev scanner pulse-access pulse-rt pulse kvm crontab vboxusers polkituser

7. I don’t think it was necessary to do, but I changed the file permissions to make sure all the devices on Bus 002 were completely accessible:

# chmod 777 /dev/bus/usb/002 -R
# ls -la /dev/bus/usb/002
total 0
drwxrwxrwx 2 root root 120 Mar 20 15:31 .
drwxr-xr-x 4 root root 80 Mar 20 15:31 ..
crwxrwxrwx 1 root usb 189, 128 Mar 20 15:31 001
crwxrwxrwx 1 root usb 189, 129 Mar 20 15:31 002
crwxrwxrwx 1 root plugdev 189, 130 Mar 20 17:37 003
crwxrwxrwx 1 root usb 189, 131 Mar 20 15:31 004

When I reboot, the file permissions revert to those shown in Step 6 above anyway.

8. Two udev rules files were created when I installed the packages:

# locate fingerprint | grep rule
/etc/udev/rules.d/91-fingerprint-gui-upek.rules
/lib64/udev/rules.d/91-fingerprint-gui-upek.rules

The file /etc/udev/rules.d/91-fingerprint-gui-upek.rules contained the following:

# udev rules for fingerprint-gui (libbsapi)

# set permissions
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="201[56]",   SYMLINK+="input/touchchip-%k", MODE="0664", GROUP="plugdev"
ATTRS{idVendor}=="147e", ATTRS{idProduct}=="201[56]",   SYMLINK+="input/touchchip-%k", MODE="0664", GROUP="plugdev"
ATTRS{idVendor}=="147e", ATTRS{idProduct}=="100[0123]", SYMLINK+="input/touchchip-%k", MODE="0664", GROUP="plugdev"
ATTRS{idVendor}=="147e", ATTRS{idProduct}=="300[01]",   SYMLINK+="input/touchchip-%k", MODE="0664", GROUP="plugdev"
ATTRS{idVendor}=="147e", ATTRS{idProduct}=="500[23]",   SYMLINK+="input/touchchip-%k", MODE="0664", GROUP="plugdev"

# enable power saving
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="201[56]",   ATTR{power/control}=="*", ATTR{power/control}="auto"
ATTRS{idVendor}=="147e", ATTRS{idProduct}=="201[56]",   ATTR{power/control}=="*", ATTR{power/control}="auto"
ATTRS{idVendor}=="147e", ATTRS{idProduct}=="100[0123]", ATTR{power/control}=="*", ATTR{power/control}="auto"
ATTRS{idVendor}=="147e", ATTRS{idProduct}=="300[01]",   ATTR{power/control}=="*", ATTR{power/control}="auto"
ATTRS{idVendor}=="147e", ATTRS{idProduct}=="500[23]",   ATTR{power/control}=="*", ATTR{power/control}="auto"

The file /lib64/udev/rules.d/91-fingerprint-gui-upek.rules contained the following:

# udev rules for fingerprint-gui (libbsapi)

# set permissions
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="201[56]", SYMLINK+="input/touchchip-%k", MODE="0664", GROUP="plugdev"
ATTRS{idVendor}=="147e", ATTRS{idProduct}=="201[56]", SYMLINK+="input/touchchip-%k", MODE="0664", GROUP="plugdev"
ATTRS{idVendor}=="147e", ATTRS{idProduct}=="100[01]", SYMLINK+="input/touchchip-%k", MODE="0664", GROUP="plugdev"
ATTRS{idVendor}=="147e", ATTRS{idProduct}=="3000",    SYMLINK+="input/touchchip-%k", MODE="0664", GROUP="plugdev"

# enable power saving
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="201[56]", ATTR{power/level}=="*", ATTR{power/level}="auto"
ATTRS{idVendor}=="147e", ATTRS{idProduct}=="201[56]", ATTR{power/level}=="*", ATTR{power/level}="auto"
ATTRS{idVendor}=="147e", ATTRS{idProduct}=="100[01]", ATTR{power/level}=="*", ATTR{power/level}="auto"
ATTRS{idVendor}=="147e", ATTRS{idProduct}=="3000",    ATTR{power/level}=="*", ATTR{power/level}="auto"

9. After reading a post in the Fingerprint GUI Forum (see quote further on) I decided to delete a file in /var/upek_data/ but, in retrospect, I’m not sure it was necessary, and, in any case, the file was subsequently recreated (perhaps when I reinstalled the packages?) and apparently has no adverse effect at present:

# ls -la /var/upek_data/
# rm /var/upek_data/.NVMe3031dcc911668f65aaeb5209f4db5ad5be21fbdbc810ac101963da0bf952f9a.bin

I had decided to delete the file because I was seeing the error message “ABSOpen() failed -1057 (Fingerprint sensor device communication error.)” in the log file /var/log/messages, and a post in the Fingerprint GUI Forum suggested deleting the file:

> Setting up the NVM emulation caused fingerprintGUI not to directly display the error, but after a second or two. Auth.log now shows a different error.

Yes. This one:

ABSOpen() failed -1057 (Fingerprint sensor device communication error.)

In some cases I’ve seen that removing all *.bin files in /var/upek/ did help. Try it.

In other cases there was some other process which had held open the device (e.g. a virtual machine running Windows on that host).

W.U.

Wolfgang Ullrich
March 18th, 2010 10:06am

(The Fingerprint GUI Forum refers to error messages being in a log file /var/log/auth.log, but, in my case, they were in the log file /var/log/messages.)

10. Anyway, now when I press e.g. Ctrl-Alt-F2 to open a VT, as usual I see a login prompt:

meshedgedx login:

However, when I enter my username and press Enter, not only is the usual Password prompt displayed but some additional text is displayed below it:

meshedgedx login: fitzcarraldo
Password:
Fingerprint Login 1.04
Authenticating fitzcarraldo
Swipe your finger or type your password:

If I enter my password, I am logged in as usual. But if I instead swipe my finger on the fingerprint scanner, I am also logged in. Nice. :-)

11. If I open a Konsole window and enter any command using sudo, let’s say sudo whoami for example, I am prompted as usual for my user password but now a GUI widget (see image below) also pops up prompting me to swipe my finger over the fingerprint scanner. Either entering my password or swiping my finger will allow me to launch the command. Nice. :-)

Fingerprint GUI widget

12. The instructions in Ref. 3 say to launch fingerprint-gui using sudo to register a fingerprint for the root user (i.e. to enable you to use the fingerprint scanner in order to log in as root user from e.g. a Konsole/Terminal window). In fact I had to use the command kdesu fingerprint-gui to launch Fingerprint GUI and register a fingerprint to enable me to log-in as the root user either by entering the root user’s password as usual or by swiping my finger. Having done that, now when I enter the su command in a Konsole window I am prompted to enter the root user’s password as usual but am also prompted to swipe my finger instead if I want:

$ su
Password:
Fingerprint Login 1.04
Authenticating root
Swipe your finger or type your password:
OK
No protocol specified
No protocol specified
#
# whoami
root
#

Nice. :-)

By the way, this also means I can swipe my finger to log-in as root user via a VT.

According to the Fingerprint GUI Forum, the error messages “No protocol specified” shown above are confined to KDE. It is possible to avoid them by using an export command first:

$ export XAUTHORITY=~/.Xauthority
$ su
Password:
Fingerprint Login 1.04
Authenticating root
Swipe your finger or type your password:
OK
#
#

I simply added the export command to my ~/.bashrc file, and the problem is fixed.

13. My only problem now is with the kdesu command: I have to enter both the root user's password and swipe my finger to launch an application using kdesu. For example, if I enter the command kdesu kwrite in a Konsole window, I am first prompted by a KDE pop-up window to enter the root user's password as usual, and, once I have entered the password in that window, I am then prompted in the Konsole window to swipe my finger. I have to do both in order for the kdesu command to execute.

14. According to Ref. 1, a limitation in KDM means that it is not possible to use the fingerprint scanner to log-in to KDE (although no such limitation exists in the case of GDM: see Ref. 3 for details). However, I'm using KDM and KDE 4.8.1 and, as soon as I enter my user name on the KDM login page, the Fingerprint GUI window pops up prompting me to swipe a finger or type my login/password. If I do either then I am logged in to KDE. Nice. :-)

So, there you have it: Fingerprint GUI 1.04 + UPEK BSAPI SDK for Linux 3.5.2 + KDE 4.8.1 + Gentoo Linux + Upek TCS5B (147e:1001) fingerprint scanner are a working combination. Kudos to Wolfgang Ullrich for creating Fingerprint GUI (and the Web site to accompany it).

REFERENCES

1. Fingerprint GUI

2. Gentoo's Bugzilla – Bug Report No. 341105 – fingerprint-gui (new package)

3. Fingerprint GUI Step-by-Step Manual

4. Fingerprint GUI User's Manual

EDIT (May 23, 2012): An ebuild for Fingerprint GUI was added to the Portage main tree on May 21, 2012. It is not identical to the ebuild I posted here a couple of months ago but also installs version 1.04 of the utility, so try merging the package from the main Portage tree as that is an easier way to install it.

AMD Catalyst for Linux driver 12.2 fixes the XVideo bug that crashed X.Org Server 1.11.x

Just a brief ‘heads up’ for users of the closed-source FGLRX driver in Linux: In a previous blog post I mentioned a bug in the AMD Catalyst driver for Linux that caused X.Org Server 1.11.x to crash if you tried to play a video and your media player was configured to use XVideo (Xv) output. The bug also meant that people talking to you via Skype could not enable their Web cams or X.Org Server 1.11.x would crash on your machine, as Skype uses XVideo.

The problem occurred with versions 11.11, 11.12 and 12.1 of the FGLRX driver (the package x11-drivers/ati-drivers). Well, today I installed version 12.2 of the driver and am pleased to report that I can again set media players to use Xv output without causing the X.Org Server to crash (I’m currently using xorg-server-1.11.4). Likewise, other people who I am talking to via Skype can again enable their Web cams without causing the X.Org Server on my machine to crash.

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.

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!

KDE 4 Service Menu Editor

You would have thought that it would be possible to edit the KDE Service Menu (the menu that you see when you right-click on an entry in a Dolphin or Konqueror window) or add your own commands to it. However, this is not a feature of KDE 4 to date (June 2011). Fortunately, KDE developer David Edmundson produced a handy GUI utility to do just this. His blog post KDE Service Menu Editor and KDE-Apps.org entry give the details.

I hope this utility will become part of KDE in a future release, but, until it does, below I explain how I installed it in KDE 4.6.2 for Sabayon Linux. The same procedure should apply in the case of Gentoo Linux.

1. Download kservicemenueditor-0.2a.tar.gz and extract it to ~/kservicemenueditor-0.2a/

2. N.B. This step is distribution-dependent, and may not be necessary for your distribution. Use the following command to determine whether or not you need to perform this edit:

$ kde4-config --path data

If the above command returns the following paths:

/home/fitzcarraldo/.kde4/share/apps/:/usr/share/apps/

then edit setup.py and change the line:

('share/kde4/apps/servicemenueditor', glob.glob("*.ui")),

to:

('share/apps/servicemenueditor', glob.glob("*.ui")),

3. To install KDE Service Menu Editor:

$ cd ~/kservicemenueditor-0.2a/
$ su
Password:
# ./setup.py install
# exit
exit
$

4. To launch the utility, either run it on the command line from your normal user account:

$ servicemenueditor

or double-click the Desktop Configuration File servicemenueditor.desktop (which you can place on your Desktop or in any other directory).

5. Usage example:

Let’s assume you want to make a right-click menu for compressing a file with GZip. In that case you would carry out the steps listed below.

a) Launch servicemenueditor.
b) Click ‘Add’.
c) In the box type the name “compress” (without the quotes) and click ‘OK’.
d) Click on the ‘Conditions’ tab and select ‘All Files’ as you want to be able to work on all files.
e) Click the ‘Action’ tab and enter “Compress Files” (without the quotes) in the ‘Label’ box. This is what will appear in the ‘Actions’ Menu.
f) Click on the blank icon and select an icon of your choice.
g) In the ‘Exec’ box, type the command needed. For this example “gzip %u” would be the command.

Converseen, a GUI batch image converter and resizer using Qt4 and ImageMagick

I normally use ImageMagick on the command line to convert and/or resize my photographs, and the two commands I use are convert and mogrify. However, I learned recently of Converseen, a GUI tool for batch conversion and resizing of image files which is a front-end for ImageMagick. Although it’s easy enough to use the command line, a GUI tool does save having to remember the command syntax each time, so I thought I’d install Converseen in Gentoo. Converseen is not in the main Portage tree, but I found an ebuild for version 0.2 from the qting-edge overlay. However, rather than add the overlay I decided instead to use a local overlay to install Converseen, which is currently at version 0.4.1, and the procedure I used is given below.

1. I downloaded to ~/Desktop/ the ebuild file from http://gitorious.org/gentoo-qt/qting-edge/blobs/master/media-gfx/converseen/converseen-0.2.ebuild and renamed it as converseen-0.4.1.ebuild, which contains the following:

# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI="2"

LANGSLONG="it_IT pl_PL"

inherit qt4-edge

MY_P=${PN}-${PV}

DESCRIPTION="GUI image conversion tool based on imagemagick"
HOMEPAGE="http://converseen.sourceforge.net"
SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.bz2"

LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="debug"

DEPEND="x11-libs/qt-gui:4
|| ( media-gfx/graphicsmagick[imagemagick] media-gfx/imagemagick )"
RDEPEND="${DEPEND}"

S="${WORKDIR}/${MY_P}"

DOCS="README"

src_prepare() {
qt4-edge_src_prepare

sed -i -e "s!/usr/lib!/usr/$(get_libdir)!" ${PN}.pro \
|| die "sed libdir failed"

local ts_files=
for lingua in ${LINGUAS}; do
for a in ${LANGSLONG}; do
if [[ ${lingua} == ${a%_*} ]]; then
ts_files="${ts_files} loc/${PN}_${a}.ts"
fi
done
done
local qm_files="${ts_files/.ts/.qm}"

sed -e '/^ loc/d' \
-e "s!\(TRANSLATIONS += \).*!\1${ts_files}!" \
-e "s!\(translations\.files = \).*!\1${qm_files}!" \
-i ${PN}.pro || die "sed translations failed"
}

2. I downloaded to ~/Desktop/ the file qt4-edge.eclass, which contains the following:

# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

# @ECLASS: qt4-edge.eclass
# @MAINTAINER:
# Ben de Groot ,
# Markos Chandras ,
# Davide Pesavento ,
# Dominik Kapusta
# @BLURB: Experimental eclass for Qt4 packages
# @DESCRIPTION:
# This eclass contains various functions that may be useful when
# dealing with packages using Qt4 libraries. Requires EAPI=2.

inherit base eutils multilib qt4-r2 toolchain-funcs

export XDG_CONFIG_HOME="${T}"

qt4-edge_pkg_setup() {
if [[ -z ${I_KNOW_WHAT_I_AM_DOING} ]]; then
ewarn
ewarn "Please file bugs on bugs.gentoo.org and prepend the summary with"
ewarn "[qting-edge]. Alternatively, contact qt@gentoo.org."
ewarn "Thank you for using qting-edge overlay."
ewarn
ebeep 5
fi
}

qt4-edge_src_unpack() {
debug-print-function $FUNCNAME "$@"

qt4-r2_src_unpack "$@"
}

# @FUNCTION: qt4-edge_src_prepare
# @DESCRIPTION:
# Default src_prepare function for packages that depend on qt4. If you have to
# override src_prepare in your ebuild, you should call qt4-edge_src_prepare in it,
# otherwise autopatcher will not work!
qt4-edge_src_prepare() {
debug-print-function $FUNCNAME "$@"

qt4-r2_src_prepare
}

# @FUNCTION: qt4-edge_src_configure
# @DESCRIPTION:
# Default src_configure function for packages that depends on qt4. If you have to
# override src_configure in your ebuild, call qt4-edge_src_configure in it.
qt4-edge_src_configure() {
debug-print-function $FUNCNAME "$@"

qt4-r2_src_configure
}

# @FUNCTION: qt4-edge_src_compile
# @DESCRIPTION:
# Default src_compile function for packages that depends on qt4. If you have to
# override src_compile in your ebuild (probably you don't need to), call
# qt4-edge_src_compile in it.
qt4-edge_src_compile() {
debug-print-function $FUNCNAME "$@"

qt4-r2_src_compile
}

# @FUNCTION: qt4-edge_src_install
# @DESCRIPTION:
# Default src_install function for qt4-based packages. Installs compiled code,
# documentation (via DOCS variable) and translations (via LANGS and
# LANGSLONG variables).
qt4-edge_src_install() {
debug-print-function $FUNCNAME "$@"

qt4-r2_src_install

# install translations # hwoarang: Is this valid for every package???
# need to have specified LANGS or LANGSLONG for this to work
[[ -n "${LANGS}" || -n "${LANGSLONG}" ]] && prepare_translations
}

# Internal function
_do_qm() {
debug-print-function $FUNCNAME "$@"
[[ $# -ne 2 ]] && die "$FUNCNAME requires exactly 2 arguments!"

local transfile="$(find "${1}" -type f -name "*${2}".qm)"
if [[ -e ${transfile} ]]; then
INSDESTTREE="/usr/share/${PN}/${1#${S}}" \
doins "${transfile}" \
|| die "failed to install ${2} translation"
else
eerror
eerror "Failed to install ${2} translation. Contact eclass maintainer."
eerror
die "Failed to install translations"
fi
}

# @VARIABLE: TRANSLATIONSDIR
# @DESCRIPTION: Translations directory. If not set, ${S} will be used

# @FUNCTION: prepare_translations
# @DESCRIPTION:
# Choose and install translation files. Normally you don't need to call
# this function directly as it is called from qt4-edge_src_install.
prepare_translations() {
debug-print-function $FUNCNAME "$@"

# Find translations directory
# Changed default to . - crazy upstreams :)
local roottrdir="${TRANSLATIONSDIR:-${S}}" trdir=.
for dir in lang langs translations; do
[[ -d ${roottrdir}/${dir} ]] && trdir="${roottrdir}/${dir}"
done

local lang=
for lang in ${LINGUAS}; do
for x in ${LANGS}; do
[[ ${lang} == ${x%_*} ]] && _do_qm "${trdir}" ${x}
done
for x in ${LANGSLONG}; do
[[ ${lang} == ${x} ]] && _do_qm "${trdir}" ${x}
done
done
}

EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_configure src_compile src_install

3. I synchronised the Portage main tree’s ebuilds on my PC with those in the repositories:

# emerge --sync

4. I made sure that /etc/make.conf has the following lines at the end of the file:

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

5. I created the necessary directories in the local overlay:

# mkdir -p /usr/local/portage/media-gfx/converseen
# mkdir -p /usr/local/portage/eclass

6. I made sure Portage would not nag me about a missing name for my local overlay:

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

7. I copied the converseen ebuild and eclass file into the relevant directories:

# cp /home/fitzcarraldo/Desktop/converseen-0.4.1.ebuild /usr/local/portage/media-gfx/converseen/
# cp /home/fitzcarraldo/Desktop/qt4-edge.eclass /usr/local/portage/eclass/

8. I generated the manifest for the package:

# cd /usr/local/portage/media-gfx/converseen/
# ebuild converseen-0.4.1.ebuild manifest

9. I merged the package:

# emerge -1v converseen

An entry for Converseen was added to Kickoff > Applications > Graphics, and I can either use that to launch it or I can launch it from the command line by entering the command converseen. The user interface is easy to master, and I’ve already put Converseen to use at work and at home. Overall, then, a useful addition to my KDE toolkit.

EDIT (July 23, 2012}: There is an ebuild for Converseen in Portage these days, so use that instead to install Converseen.

Follow

Get every new post delivered to your Inbox.

Join 26 other followers