Posts tagged ‘keysafe’

Odds and ends for my Arch desktop

After the previous setup steps I found the next task was to add a few odds and ends really were needed before proceeding to other major things, like audio, email, and such. Several of the things I needed are available from AUR so to make things easier I started by adding archlinuxfr to my /etc/pacman.conf:

--- pacman.conf_orig    2009-05-09 18:47:19.825013872 +0100
+++ pacman.conf 2009-04-26 08:22:05.471685249 +0100
@@ -70,6 +70,9 @@
 # Add your preferred servers here, they will be used first
 Include = /etc/pacman.d/mirrorlist

+[archlinuxfr]
+Server = http://repo.archlinux.fr/x86_64
+
 # An example of a custom package repository.  See the pacman manpage for
 # tips on creating your own repositories.
 #[custom]

After that I updated the package listings (pacman -Sy) and installed yaourt (pacman -S yaourt).

After this I could easily install the other packages I need:

  1. nautilus-dropbox
  2. encfs
  3. pam_mount
  4. keysafe
  5. hpodder
  6. twitux

Only pam_mount needed some extra configuration. First I added two lines each to /etc/pam.d/gdm and /etc/pam.d/login:

auth        optional    pam_mount.so
session     optional    pam_mount.so

Then I modified /etc/security/pam_mount.conf.xml to allow users to have their own configs, that’s done by uncommenting the line

<luserconf name=".pam_mount.conf.xml" />

Keysafe and screenshots.debian.net

After reading about screenshots.debian.net I’ve now uploaded a screenshot for the only package I have in Debian, keysafe. It will be visible to the public as soon at it has been approved.

Keysafe in Debian

Since a few days Keysafe is in Debian!

It’s both my first Debian package and the first time I’m “upstream”. Now I can point to something that I’ve given back, so this is a big thing for me. Next Debian target to reach—becoming a Debian Developer :-)

Experiencing Arch Linux

I’ve just “finished” installing Arch Linux. (I don’t think I’ll ever be finished for real since Linux is such a dynamic place. However, I’ve installed enough of Arch Linux to be writing this using Epiphany, running on a slick GNOME desktop.)

So far Arch has proven to be a nice, well designed system with a lean feel to it. Being used to Debian (lately Ubuntu) and its extreme attention to detail, Arch does give a more rough impression. It’s a price I think is worth paying, and believe me, it’s not as bad as it sounds. I’ve spent about 2 hours getting the base system, postfix, X.org, and GNOME installed and configured properly. A few small details remain, but I would have to attend to those no matter what distro I choose (getting HAL to refrain from mounting one of the partitions on my USB stick isn’t something that comes pre-configured in any distro I know of :) ).

The only thing left doing now is building proper Arch packages for muttng and keysafe.

GConf in Python

It just didn’t feel right to have KeySafe use a Windows-style INI file for its configuration so I started looking into using GConf instead.

There are good introductions to GConf here and here. Translating it all to Python is simple thanks to the brilliant people who gave us Gnome-Python.

I wrote this code for viewing the setting of the desktop background’s filename:

#! /usr/bin/python

import gtk
import gtk.glade
import gconf

class GConfViewer:
    def __init__(self):
        gui = gtk.glade.XML('Viewer/viewer.glade')
        self.entry = gui.get_widget('entry')

        client = gconf.client_get_default()
        client.add_dir('/desktop/gnome/background',
                gconf.CLIENT_PRELOAD_NONE)
        client.notify_add('/desktop/gnome/background/picture_filename',
                self.new_background)
        self.new_background(client)
        gui.get_widget('window').show_all()

    def new_background(self, client, *args, **kwargs):
        filename = client.get_string(
                '/desktop/gnome/background/picture_filename')
        self.entry.set_text(filename)

if __name__ == '__main__':
    GConfViewer()
    gtk.main()

I really like the client-server nature of it. A short explanation:

  1. Get the default GConf client.
  2. Add directories.
  3. Tell it to watch a specific key, specifying a callback method to be called when its value is changed.
  4. Define the callback method.

I also wrote code to change the value of a key:

#! /usr/bin/python

import gconf

def set_bool_key(key):
    client = gconf.client_get_default()
    client.set_bool(key, 1)

if __name__ == '__main__':
    set_bool_key('/desktop/gnome/background/draw_background')

Quite self-explanatory, isn’t it?

The next step in development would be to create a schema for the keys. Both introductions above contain pointers on how to write schemas, for more pointers just take a look in /usr/share/gconf/schemas/. The only problem I ran into was registering the schema. The following commandline does the trick:

GCONF_CONFIG_SOURCE=$(gconftool-2 --get-default-source) \
gconftool-2 --makefile-install-rule keysafe.schemas

Of course the kind Debian developers have done their best to shield packagers from nitty-gritty details. CDBS didn’t just work, it seems to make assumptions about the build system of the package (assuming it’s using auto-tools). Just making sure that the schema ends up in usr/share/gconf/schema during package binary-install, then call dh_gconf -ppackage in binary-post-install/package did the trick.