Custom responses to HAL events

Boyan Tabakov blade.alslayer at
Wed Nov 15 08:28:45 GMT 2006

On 15.11.2006 00:51, Cathal O'Brien wrote:
> > I've got an icon that does what I want, what I would like is for that
> > icon to
> > be hidden when the PDA is not plugged in and then automatically appear on
> > the
> > desktop when I plug in the PDA.  It's not essential - just wondering if
> > there
> > was a way to do it :-)
> >
> > --
> > Paul
> > ___________________________________________________
> > This message is from the kde mailing list.
> > Account management:
> > Archives:
> > More info:
> Nah i cant say its not possible but i was doing something like that with an
> external device before and the icon was always their. Dont know of a way to
> hide the icon once unplugged. Does anyone else know whether this is
> possible?

I am not sure if you accomplish this by means of KDE, but here is what I'd do 
to make it work:
You have hal, right? There is a command line tool called hal-device that lists 
all the devices recognized by hal that are connected to the system. Type 
hal-device | less and look through the list when your PDA is connected. Find 
the line that identifies it. You can then right a simple daemon that monitors 
when this device is plugged and make it show/hide your desktop icon.
It ma look something like this:


while true ; do

if [ `hal-device | grep "identification string goes here" | wc -l` -ge 1 ]
	-f ~/Desktop/.My\ Hidden\ Icon &&
	mv ~/Desktop/.My\ Hidden\ Icon ~/Desktop/My\ Visible\ Icon
	-f ~/Desktop/My\ Visible\ Icon &&
	mv ~/Desktop/My\ Visible\ Icon ~/Desktop/.My\ Hidden\ Icon

sleep 5 # sleep for 5 seconds before attempting to refresh


Just make sure the script is started when you launch KDE, buy copying it to 

There maybe are ways to detect the kernel notification upon the PDA connect, 
but I don't know how to do that...

Blade hails you...

Put a stake through my heart
And drag me into sunlight
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <>
-------------- next part --------------
This message is from the kde mailing list.
Account management:
More info:

More information about the kde mailing list