General questions about HAL

David Zeuthen david at fubar.dk
Sun Feb 26 12:52:49 PST 2006


Hi,

On Sun, 2006-02-26 at 12:26 +0100, Dik Takken wrote:
> On Sun, 26 Feb 2006, Niki Kovacs wrote:
> 
> > I've seen some implementations of HAL on distros like Aurox, Suse or Freerock
> > GSB, but they're all quite buggy. If the perfect distro shipping HAL existed, I
> > would gladly use it. (I must add that the desktop I use is a personal mixture of
> > XFCE 4.2.3.2 with a minimal set of GNOME-libs... modern yet working on old
> > hardware)
> 
> I am just an ordinary Linux user trying to customize how HAL interacts 
> with the desktop (KDE in my case). I also think that the existing HAL 
> integration in the current Linux desktop is not good enough (and not 
> really customizable), so I write my own event handling scripts. I guess 
> there are many Linux users who would like to play with this, but it is not 
> easy to get the information that you need.
> 
> Fortunatly, I managed to get HAL to do *exactly* what I want it to do.
> 
> This is what I did:
> 
> * Create some custom fdi files that call BASH scripts when new hardware is 
> added or removed
> * Have these BASH scripts gather information about the device 
> (mountpoint, entry in /dev, type of device, etc ) using 
> hal-get-property and write it to a file on disk
> * Create another BASH script that is run (in the Autostart directory of 
> KDE) by the user. This script watches for device information files to 
> appear. When such a file appears, it displays an informative message on 
> the users desktop like

No, no, no, this is just plain wrong. The thinking behind HAL is to let
daemons in the desktop session intercept events from HAL using the
system message bus (e.g. D-BUS). I know that 

 http://webcvs.freedesktop.org/*checkout*/hal/hal/doc/spec/hal-spec.html

is a bit out of date (something we want to fix though) but at least the
ideas of connecting the desktop session with the system bits (like HAL)
through the system message bus should be adequately explained. You
should be able to write a e.g. 20 line python script for doing just
this...

> "Found a Canon Powershot digital PTP camera"
> 
> and then it just does the thing you want it to do, like copy photographs 
> to the DigiKam photo album, launch a DVD player, or automount a USB key 
> and display its contents in a Konqueror window.

I thought KDE 3.5 and later already included functionality similar to
GNOME Volume Manager? Ie. it should work out of the box...

    David




More information about the hal mailing list