Alexander Kojevnikov | Blog

Introducing Spek

I just released version 0.1 of Spek -- a little program that shows spectrograms of audio files. Spek is written in Vala and uses the standard GNOME stack: GLib, GTK+, Cairo and GStreamer.

Spectrogram of a FLAC file

Spectrograms are used to analyse the quality of audio files, you can easily detect lossy re-encodes, web-rips and other badness by just looking at the spectrogram.

This version of Spek doesn't do much apart from showing the actual spectrogram and allowing to save it as a PNG image. However, I plan to add a bunch of features before releasing version 1.0:

You can download the tarball from the project's website. To build and run:

% tar -xjvf spek-0.1.tar.bz2
% cd spek-0.1
% ./configure
% make
% src/spek

Or sudo make install to have it installed.

Contribute

The code is available on Gitorious. I really need and will appreciate help in these areas:

Why Vala?

I initially wanted to write Spek in Haskell to practice the language after reading The Haskell School of Expression (generously sent to me by Jorge). However, after writing a bit of code I realised that all the functional goodness of Haskell is not used at all because Spek is simply a bit of glue between GTK+ and GStreamer, with very little code of its own. Also, the prototype's executable size of 14+ MiB didn't help much in convincing myself that Haskell was a good pick for this project.

I was left with C and C#. The latter didn't feel like a good idea for the same reasons: I wanted something lightweight for this small little app, C# would require a lot of dependencies. Also, while I really like C# as a language and Mono/.NET as a platform, I wanted to try something new for a change -- I already use them full-time on my day job and when hacking Banshee.

I wrote very little C/C++ code since late 90's, now I know why I didn't miss it much -- it's so incredibly verbose! After a few hours I gave up, decided to do some research and found Vala :)

The impression so far is hugely positive. Vala still has a few rough edges but nothing too bad and not work-aroundable. If you are tired of using C for your GTK+ applications, definitely give it a try!

Published: 2010-05-10

Tags: gnome spek

DIY NAS with Debian Lenny

After playing with FreeNAS I ended up using Debian for my server. FreeNAS is a great distribution if you want an out of the box experience, but I found it hard to customise, mostly because I'm not very familiar with BSDs. Also, they are switching to Debian for the next version. So, Debian it is.

This post will explain how to set up a NAS server with Debian running essential services such as ssh, samba, nfs, cups, rdiff-backup and rtorrent with a web interface; and using two HDDs in RAID 1 mode with everything encrypted. It took me awhile to research all bits and pieces, hopefully it will save you time if you are going to do a similar set up.

Table of contents

Hardware

I use a VIA ARTiGO A2000 barebone storage server. It's powered by a VIA C7-D processor, which has a built-in encryption engine called Padlock — quite useful for our scenario. If you are unsure which server to get, I can highly recommend A2000.

Some parts of this walk-through are specific to A2000 or C7, but most of it will apply to any hardware as long as it includes two HDDs and is compatible with Lenny.

Partition layout

I assume that you know how to use the Debian installer, if not — check the documentation. Because A2000 doesn't have a CD-ROM, I booted the installer from a memory stick, you might need to do the same.

The tricky part of the installation process is disk partitioning. I used the following layout, though there are many ways to do the set up.

First we create RAID 1 partitions. We need a separate partition for /boot, because it won't be encrypted; and for /tmp, because it will have encryption settings different from the root partition. This means we will have three partitions on each disk:

Phew, that was quite a few steps! Now you will see three RAID1 devices in the list, let's set them up:

You should see two encrypted volumes now: md1_crypt is automatically set up to be used as swap (do it manually if it's not); md2_crypt however needs more tweaking.

That's it! With this scheme, data and root partitions sit on top of an LVM group, which sits on top of an encrypted volume, which sits on top of a multi-disk volume. Some people prefer to have separate encrypted partitions for root and for data, but then you will need to enter passphrases for each of them on start up.

Finalising the installation and fixing GRUB

The rest of the installation should be straight-forward. When you reach the "Software selection" screen, make sure you choose "Standard system" and "File server"; and unselect "Desktop environment" — you are not going to need it on a headless server. Also tick off "Print server" if you need (I do).

After everything is installed, boot your server, type your passphrase to unlock the encrypted partition, and login as root. Now, because the installer writes GRUB only to the first disk, we need to install it manually to the second. Without this, if your first disk fails you won't be able to boot:

# grub
grub> root (hd1,0)
grub> setup (hd1)
grub> quit

SSH and sudo

Let's install SSH, otherwise we will need a spare monitor and a keyboard connected to the server:

# aptitude update
# aptitude install ssh

Edit /etc/ssh/sshd_config, I suggest disabling PermitRootLogin and PasswordAuthentication and enabling PubkeyAuthentication. If you decide to use public key authentication, add your public key to ~/ssh/authorized_keys. Then restart sshd, install sudo, and edit the list of sudoers:

# /etc/init.d/ssh restart
# aptitude install sudo
# visudo

Add this line under root, <user> is your non-root login:

<user> ALL=(ALL) ALL

Padlock modules

This section is specific to VIA C7 CPU. As I mentioned, it includes the hardware encryption engine called Padlock. The engine is supported by the Linux kernel, but the support is not enabled by default.

First make sure you have it:

# modprobe padlock_aes
# modprobe padlock_sha

If the modules load fine, these steps (thanks Google Translate!) will auto-load them:

alias aes padlock_aes
padlock-aes  
padlock-sha

These steps are needed because Padlock modules must be loaded at boot, to work with our encrypted partitions. If they are loaded at a later stage, the software encryption modules will not be replaced because they are already in use.

After rebooting, check if Padlock is used. If aes_i586 is in use instead of padlock_aes, you did something wrong:

# lsmod | grep -i aes

To enable hardware encryption for SSL, edit /etc/ssl/openssl.cnf and add this before the [new_oids] section:

openssl_conf = openssl_def

[openssl_def]
engines = openssl_engines

[openssl_engines]
padlock = padlock_engine

[padlock_engine]
default_algorithms = ALL

After the change, observe an enormous speed bump with:

# openssl speed -evp aes-128-cbc

NFS

If you selected "File server" during the installation, NFS should already be up and running. To share the entire /data partition, edit /etc/exports and add this line:

/data   *(rw,sync,no_subtree_check)

Check NFS documentation if you want something different. After changing your exports, reload them with:

# exportfs -a

On the client computers, add this line to /etc/fstab, replacing <server> with the IP of your NAS:

<server>:/data /mnt/data nfs defaults 0 0

Then mount with mount -a. Again, check the docs if you need more control over how the NFS share is mounted.

Samba

As with NFS, Samba should already be running on your server. Append this to /etc/samba/smb.conf, replacing <user> with a non-root login on your server:

[data]
    path = /data
    browseable = yes
    available = yes
    public = yes
    writable = yes
    force user = <user>
    create mask = 0644
    directory mask = 0755

Then restart Samba and you are set:

# /etc/init.d/samba restart

Check Samba docs for more options.

CUPS

The set up heavily depends on the printer model. I have a fairly common Epson colour ink printer, its driver is included in the gutenprint package which gets installed if you select "Print server" during the installation.

You will need to edit /etc/cups/cupsd.conf to make the CUPS web interface accessible from another machine, then just add your printer from http://localhost:631/. Also check /etc/samba/smb.conf, it should have these sections:

[printers]
   comment = All Printers
   browseable = yes
   path = /var/spool/samba
   printable = yes
   guest ok = yes
   read only = yes
   create mask = 0700

[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   browseable = yes
   read only = yes
   guest ok = no

Check CUPS docs if it doesn't work or if you want to fine-tune permissions.

rTorrent + ruTorrent

FreeNAS comes with Transmission BitTorrent client. It looks nice but the web interface is too simple to my taste, it doesn't even support labels. On the desktop I used to run Deluge, which is great but probably a bit heavy for a small server. After a bit of research I ended up using rTorrent, which is what most blogs recommend for a headless server.

There are quite a few frontends for rTorrent, the one I liked was ruTorrent, its development also seems to be the most active at the moment. It's an almost exact rip-off of a popular Windows-based μTorrent client, hence the name.

ruTorrent requires a recent version of rTorrent compiled with the XML-RPC support. The bad news is that Lenny doesn't have all packages required to build it. This can be circumvented by temporarily switching to testing (aka Squeeze), installing rTorrent's build-deps, then switching back to Lenny. Depending on your situation, switching to testing may not be the best idea, do it only if you are comfortable breaking your system.

After installing build-deps, get the latest tarball of rTorrent, ./configure it with --with-xmlrpc-c option, make and make install. Afterwards, copy an example .rtorrent.rc file to ~/ and edit it to suit your needs. Also follow the steps in the Starting rTorrent on System Startup section.

ruTorrent can work with any web server supporting PHP 5.0, I went for lighttpd. Install it from the official repo, then follow ruTorrent set up guide.

The tricky part is setting up XML-RPC, there are a few contradictions in the the rTorrent and ruTorrent docs but the following works for me™:

Add to ~/.rtorrent.rc:

scgi_port = localhost:5000
encoding_list = UTF-8

Edit /etc/lighttpd/lighttpd.conf as described here. Ignore instructions from rTorrent, they won't work. Restart rTorrent and the web server after you are done:

# /etc/init.d/rtorrent restart
# /etc/init.d/lighttpd force-reload

Backup with rdiff-backup

rdiff-backup is such a fantastic tool: it's available on all major platforms, it's ultra fast and efficient, it performs backups incrementally, it can work over SSH and also it allows to restore files at any point of time. If you don't already use it to backup your home directories — give it a try!

On the server, there's nothing special to be done to install it. Just get it from Debian repos and add your public keys to ~/ssh/authorized_keys — we are going to use SSH.

On Linux clients, invoke it like this, replacing <user> with your login and <server> with the IP of the NAS:

% rdiff-backup /home/<user> <server>::/data/Backup/<user>

On Windows clients, install Putty and follow these steps to generate a compatible key. Then invoke rdiff-backup like this:

rdiff-backup.exe --no-hard-links --remote-schema
    "plink.exe -i C:Users<WinUser>privatekey.ppk %s rdiff-backup --server"
    C:Users<WinUser> <user>@<server>::/data/Backup/<user>

Check rdiff-backup docs for more options, there are plenty!

Performance

Extremely unscientific tests, but they give an idea:

# bonnie++ -d /data/tmp
Version 1.03d       ------Sequential Output------ --Sequential Input- --Random-
                    -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
server           2G 10862  91 63699  27 29931  12 11483  91 83455  22 196.7   0
                    ------Sequential Create------ --------Random Create--------
                    -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16  2693  67 +++++ +++  3467  37  2948  47 +++++ +++  3131  38
#
# sync
# dd if=/dev/zero bs=16384 count=131072 of=/data/tmp
131072+0 records in
131072+0 records out
2147483648 bytes (2.1 GB) copied, 40.7823 s, 52.7 MB/s
#
# sync
# dd if=/data/tmp bs=16384 count=131072 of=/dev/null
131072+0 records in
131072+0 records out
2147483648 bytes (2.1 GB) copied, 23.5763 s, 91.1 MB/s

# hdparm -tT /dev/mapper/md2_crypt 

/dev/mapper/md2_crypt:
 Timing cached reads:   584 MB in  2.01 seconds = 291.10 MB/sec
 Timing buffered disk reads:  222 MB in  3.03 seconds =  73.19 MB/sec

hda is a 1TB WD Caviar Green, hdb is a 640GB Seagate Barracuda. I know, using different disk models is bad for RAID 1, but that's what I had. At some point I will get a second 1TB WD, read the next section to find out how to grow the mirror when upgrading drives.

NFS transfers are slower, but good enough for my needs: 49 MB/sec when reading from a NFS share and 23 MB/sec when writing to it.

Growing partitions

When your RAID 1 mirror is filled up you probably want to upgrade the disks with bigger ones. This can be done by replacing the first disk, syncing the mirror, then replacing the second one, and syncing again. After that you need to grow your data partition.

So, shut down your NAS, replace one of the drives, boot up and SSH to it. Check the status the mirror, notice that only one drive is used:

# watch -n 2 cat /proc/mdstat

Personalities : [raid1]
md2 : active raid1 hda3[0]
      622679296 blocks [2/1] [U_]

md1 : active raid1 hda2[0]
      1951808 blocks [2/1] [U_]

md0 : active raid1 hda1[0]
      497856 blocks [2/1] [U_]

unused devices: <none>

Here I assume that hda is used and hdb has been replaced, run fdisk -l to check which is which in your case. Now copy the partition table from hda to hdb:

# sfdisk -d /dev/hda | sfdisk /dev/hdb

Adjust the last partition on hdb: run cfdisk /dev/hdb, select hdb3 and delete it, re-create hdb3 to use the entire free space, change the partition type to "FD Linux raid autodetect", and finally write changes to disk and quit.

Add new partitions to the RAID array and wait until the sync is finished:

# mdadm --add /dev/md0 /dev/hdb1
# mdadm --add /dev/md1 /dev/hdb2
# mdadm --add /dev/md2 /dev/hdb3
# watch -n 2 cat /proc/mdstat

Add grub to hdb:

# grubgrub> root (hd1,0)
grub> setup (hd1)
grub> quit

If you replaced the drive with a bigger one, you need to grow the last partition to take advantage of all available space. Here's how to do it (the steps are borrowed from here):

# mdadm --grow /dev/md2 --size=max

Reboot, then run this:

# pvresize /dev/mapper/md2_crypt
# vgdisplay -A | grep -i free
  Free  PE / Size       X / Y GB

Note the number X, we will use it in the next command. Also replace MAIN-data with the name you used for the /data partition:

# lvextend -l +X /dev/mapper/MAIN-data

Finally, grow the filesystem:

# xfs_growfs /data

The previous command will only work for XFS, adapt it if you use ext3 or another file system.

A2000 tweaks

Inspired by this forum post I replaced stock A2000 fans with Scythe Mini Kaze SY124010L 40mm fan on the CPU and Noctua NF-R8 80mm fan on the rear exhaust. This made A2000 even more quiet. Other than that, I cannot think of any other mod I would like to do, A2000 is a very nice piece of hardware.


  1. When creating a physical volume for encryption, you can select the encryption algorithm and the key size. I use AES, because C7 provides hardware support for it; and 128 bits instead of default 256, because I'm not paranoid. Do your research and preferably select what your hardware supports. Software encryption is likely to be slow unless you have a very fast CPU. 

Published: 2009-11-19

Tags: linux

Growing mirrored and encrypted partitions in FreeNAS

UPDATE 2009-11-19: this post explains how to do the same in Debian.

I'm building a small NAS for the household. It will run FreeNAS and will be used as a file, rsync, BitTorrent and printer server. I want it to be reliable and secure so it will have two HDDs in RAID 1 (AKA mirroring) and their content will be encrypted.

But what if in the future I will want to upgrade the drives with larger ones? A common scenario with RAID 1 is to replace one of the disks with the bigger one, rebuild the mirror then replace the other one and rebuild it again. In theory it sounds like an easy process that will keep all your data intact.

In practice however it's not, Mike explains how to do it under FreeNAS in his blog. Growing mirrored and encrypted drives is a bit more complicated.

Here is how, in case you might need it:

# geli backup /dev/mirror/raid1 bak
# geli detach /dev/mirror/raid1
# geli clear /dev/mirror/raid1
# geli restore bak /dev/mirror/raid1
# geli attach /dev/mirror/raid1
# gpt recover /dev/mirror/raid1.eli
# gpt remove -i 1 /dev/mirror/raid1.eli
# gpt add -i 1 -t ufs /dev/mirror/raid1.eli
# gpt label -i 1 -l data /dev/mirror/raid1.eli
# growfs /dev/mirror/raid1.elip1

That's it, your encrypted partition should be functional now!

NOTE: always do your backups, I can make no guarantees this guide will work for you.

Published: 2009-11-04

Tags: freenas freebsd

xmonad ⋙ metacity (mod GNOME)

xmonad is an elegantly minimalist and lightning fast window manager for X written in Haskell. I wanted to play with it for a long time: I'm using two 24" monitors and so have to spend a fair bit of time re-sizing windows and moving them around. A tiling window manager like xmonad takes care of this; in addition you can control all aspects of window placement with the keyboard alone.

The good news is: xmonad plays really well with GNOME. You can keep your GNOME panels, themes, desktop backgrounds, etc – xmonad just replaces Metacity leaving everything else intact.

The bad news is: I should have tried it earlier.

A few notes about xmonad set up and usage:

[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Xmonad
Exec=/usr/bin/xmonad
NoDisplay=true
X-GNOME-WMName=Xmonad
X-GNOME-Bugzilla-Bugzilla=XMonad
X-GNOME-Bugzilla-Product=xmonad
X-GNOME-Bugzilla-Component=general
X-GNOME-Autostart-Phase=WindowManager
X-GNOME-Provides=windowmanager
X-GNOME-Autostart-Notify=true
/desktop/gnome/session/required_components/windowmanager
xsetroot -cursor_name left_ptr
import XMonadimport XMonad.Config.Gnome main = xmonad gnomeConfig
import XMonad
import XMonad.Config.Gnome

main = do
  xmonad $ gnomeConfig
    { terminal    = "gnome-terminal"
    , modMask     = mod4Mask
    , focusFollowsMouse = False
    , borderWidth = 2
    }
import XMonad
import XMonad.Config.Gnome
import XMonad.Actions.Submap

import Control.Arrow
import Data.Bits
import qualified Data.Map as M

main :: IO ()
main = do
    xmonad $ gnomeConfig
         { terminal = "gnome-terminal"
         , focusFollowsMouse = False
         , borderWidth = 2
         , keys = addPrefix (controlMask, xK_m) (keys gnomeConfig)
         }

addPrefix p ms conf =
    M.singleton p . submap $ M.mapKeys (first chopMod) (ms conf)
    where
    mod = modMask conf
    chopMod = (.&. complement mod)

After using xmonad for 2 days I must say I'm a convert. The keyboard short-cuts feel very natural, it's not difficult to see the influence of vi. Moving a window to another screen or to another workspace (did I mention workspaces are per screen, which is a really neat feature), switching between workspaces, switching windows, changing layouts, etc... is just a short-cut away.

And as a bonus point, I now have a good reason to become more familiar with Haskell – it's a very nice language.

Published: 2009-10-18

Tags: gnome haskell xmonad

Updated Play Queue In Banshee

Banshee 1.6 will include an updated Play Queue extension. The changes are already in git master, here are a few teaser screen-shots:

Play Queue in Banshee

Played tracks are not removed from the queue but are shown as greyed out. You can play them again if you want, drag and drop to the back of the queue, delete, etc.

Play Queue Preferences

The number of played tracks to show can be changed from the preferences dialogue.

Fill By option

You can also ask Banshee to automatically update the queue using any shuffle mode (including the new by rating and by score modes). The number of upcoming tracks can also be changed in the preferences.

Fill From

The tracks are taken from the entire library or from any play list.

Refresh and Add More

If you don't like what has been added, you can refresh the upcoming tracks. Or you can add more of them (thanks Sandy!)

Manually added tracks

Tracks added manually are treated differently from those that had been added automatically. When adding, they are inserted to the front of the queue but after other manually-added tracks.

After refresh

Also, they are preserved when you refresh the queue.

That's about it. If you like what you saw you can try the git master version. Otherwise just wait until 1.6 is out, it shouldn't take too long.

Published: 2009-09-23

Tags: banshee gnome

New shuffle modes in Banshee

New shuffle modes Next version of Banshee will introduce two new shuffle modes: by rating and by score. In this post I will explain how they work since the modes can be a bit confusing.

In the random shuffle mode (aka shuffle by song), every track has an equal probability to be selected. For example if our library contains 1,000 tracks, each of them will be chosen with probability

Pt = 1 ÷ 1,000 = 0.001

But what if we want some tracks to be played more often than others? Say we have 100 favourite tracks and want to play each of them three times as often as any other track? In probability terms this can be written as

Ps = 3 × Pt

where s are our favourite tracks and t – the other 900 tracks in the library. Because the sum of all probabilities must be equal to one, we have

100 × 3 × Pt + 900 × Pt = 1 → Pt = 1/1,200

To chose the next track, we can pretend that our library contains 1,200 songs and pick one at random. If the track number is ≤ 100 × 3, we randomly select one of the 100 favourite songs, otherwise we take one of the 900 remaining songs.

If the library is partitioned into n slots, each containing Ci tracks, we will have

i=1,n Ci ⋅ wi ⋅ P1 = 1

where P1 is the probability of selecting a track from the first partition, and wi tells how frequently tracks from the i-th partition should be selected compared to the first one. That is Pi = wi ⋅ P1

Numbers wi are called weights and by changing them we control how often the songs from different slots are played. For example, we could pick a number (lets call it β) and require that songs from the second partition are played β times as often as the songs from the first one, songs from the third β times as often as the songs from the second, and so on. That is, wi = βi-1

For ratings, we have 5 partitions – one for each rating. We could also put all unrated songs into the 3-rd partition (to treat them as songs with 3 stars) so that our entire library is partitioned. Now a good question is what to use for β?

If we take β=1, all songs will have an equal probability to be selected. Note that it's exactly the same as the shuffle by song mode. If we take β=2, songs rated 5 will be played twice as often as songs rated 4, and so on.

In Banshee we use β = φ ≈ 1.61803, also known as the golden ratio. This number has an interesting property:

φn = φn-1 + φn-2

In terms of ratings, it means that songs with 5 stars will be played as often as songs with 4 and 3 stars combined, and so on.

In the shuffle by score mode, the songs are partitioned into 20 slots, first slot for the songs scoring 1…5, second – for 6…10, and the last – for scores 96…100. We also put songs with no score into the 10th slot (46…50).

We cannot use φ for β because this time we have much more partitions – the songs with low scores would be hardly ever played. To keep scores behaving similar to ratings we need to scale the weights:

β = φ¼, wi = φ(i-1)/4

Hope that wasn't too tangled and I promise next post won't include a single formula :)

Published: 2009-09-21

Tags: banshee gnome

Vertical panel in GNOME, 15 months later

Fixed vertical panel I'm happy to report that the subject is mostly fixed.

Window List: bgo#86382 has a working patch, it's not perfect (read comments 140, 141 and 145) but fixes the problem.

Notification Area: bgo#531371 also has a patch which works really well.

Quick Launch: My fix is included in version 2.12.6 of the applet.

Main Menu: The ugly arrow (bgo#562247 and bgo#564903) can be removed by setting "has-arrow" to FALSE in gnome-panel/panel-menu-button.c

Keyboard Indicator: bgo#591515 is not yet fixed. A quick and dirty hack is to comment out the entire switch statement in GSwitchitAppletUpdateAngle() function from gswitchit/gswitchit-applet.c

I'm using a GNOME desktop with all these fixes daily and I'm quite happy with it. You can get my customizepkg files for Arch Linux from GitHub; read how to use them in the previous post.

Published: 2009-09-06

Tags: gnome linux

Arch Linux + yaourt + customizepkg = beauty!

I recently switched my main desktop from Ubuntu to Arch Linux, mostly for its rolling release model. I really like Ubuntu but I got tired of dealing with lots of custom PPAs. Arch Linux not only provides the latest stable version for all packages, it also has tools to customise the packages to your liking and selectively build them from source.

In this post I will explain how to do it, taking as an example my pet peeve – the vertical Gnome panel. Carey Underwood has recently posted a (mostly) working patch, let's get it into our box.

First thing you need is to install yaourt and customizepkg, both are available in AUR. ArchWiki has a great tutorial on how to do it. Actually you only need the tutorial to install yaourt, afterwards installing packages from AUR is as simple as running:

% yaourt -S customizepkg

customizepkg allows to tweak PKGBUILDs. You just add a file to /etc/customizepkg.d/ with the same name as the package you want to change. The file format is not well documented, but it's pretty intuitive.

In our case we need to create /etc/customizepkg.d/libwnck with the following text (in one line):

replace#global#cd "${srcdir}\/${pkgname}-${pkgver}"
#cd "${srcdir}\/${pkgname}-${pkgver}"\nwget -O vertical.patch
http:\/\/bugzilla-attachments.gnome.org\/attachment.cgi?id=140334
|| return 1\npatch -Np2 -i vertical.patch || return 1

The file will tell customizepkg to add two lines to libwnck's PKGBUILD:

 build() {
   cd "${srcdir}/${pkgname}-${pkgver}"
+wget -O vertical.patch http://bugzilla-attachments.gnome.org/attachment.cgi?id=140334 || return 1
+patch -Np2 -i vertical.patch || return 1
   ./configure --prefix=/usr --sysconfdir=/etc
               --localstatedir=/var --disable-static || return 1
   make || return 1

Then you just install the package as you always do, but using yaourt instead of pacman:

% yaourt -S libwnck

Et voilà, yaourt realises that you want to build libwnck from source, gets its PKGBUILD, changes it, and builds. When building, the patch is downloaded and applied to the source code of libwnck before it's made.

But wait, there's more to it! Next time you upgrade the system with yaourt -Syu, if there is a new version of libwnck, it will be automatically patched and built from source.

Hope you find this useful, and if you haven't tried Arch yet – do it today, you won't be disappointed ;)

Published: 2009-09-05

Tags: linux

Vertical panel in GNOME

UPDATE 2009-09-06: Read the follow-up post

I've been playing with various desktop GNU/Linux distributions last couple of months. I'm not exactly a newbie to Linux, I have been administering a VPS box for a hobby project for several years now, but I never managed to play with it on a desktop.

So I did. And I must say I'm very impressed. Last time I checked (FreeBSD 4 back in 2000), FLOSS desktop was mostly a geek toy, these days it is ready for the average user.

I will spare the overview of the distros that I tried, as well as my take on the KDE vs. GNOME flame war for another post, here I want to talk about one particular annoyance that I really want to see fixed.

You see, these days it's hard not to have a wide-screen monitor sitting on your desktop. They are great for watching films and playing games but this comes at a cost -- you end up with fewer vertical pixels.

Vertical space is much more important for most other tasks I do on the computer, be it browsing the web, coding or writing blog posts. And the only way to maximise it is to move the everlasting task bar sitting on the bottom of most operating systems to the left or right of the screen.

Vertical layout in Vista Vertical layout in KDE This is how it looks like in Vista and KDE. I know it takes some getting used to, but it's worth a few days of slight disorientation. And I'm not the only one who thinks so.

The vertical layout works great in XP, Vista and KDE, but not in GNOME. I want to list here all open issues along with the links to the GNOME bug database. I guess we have all these issues because not many GNOME developers are using the vertical layout, or even aware of the benefits it can give them. I hope this post will help it, even if only a little bit.

Vertical layout in GNOME Window List: The list of open windows is arguably the most important piece of information sitting on the panel. And the most terribly behaving in vertical layout.

First of all, the height of the window list applet is fixed, meaning the list doesn't occupy all available vertical space.

Second, the height of the buttons that represent the open windows, stretches to fill the entire applet. The buttons should have a fixed height that depends on the font used in the buttons.

Third, after you open a few windows, the list splits to two columns and becomes irresponsible to mouse clicks. This is the most annoying bug of the three.

These issues are documented in bug 86382 that was open back in 2002! The bug has a patch, but it looks like it's not perfect either.

Notificatioin Area: In vertical layout the notification area wastes a lot of space by placing one icon in a row. It also uses different sizes for different icons, some are really huge, e.g. 128x128. It should instead use a flow layout for icons and use the same size for all of them. This is described in bug 531371.

Quick Launch: The quick-lounge applet had a bug that made it nearly impossible to use on a vertical panel (see bug 531358). It's fixed now in the trunk, hopefully it will be integrated into the next GNOME release.

There are other related annoyances (see bug 428943 and Ubuntu idea #1906) but I can live with them if the above issues are resolved.

Published: 2008-06-08

Tags: gnome linux

« Page 3 / 3