Hello,
I have a USB Transcend pendrive capable of storing 128MB size. I have written a script which will be read by the automount program
to mount the pendrive at a location /home/seran/removable/usbthumb.
If the pen drive is plugged in "usbthumb" directory will be created.
If the pen drive is unplugged the "usbthumb" directory will disappear.
After plugging in the pendrive all the files are listed at the location /home/seran/removable/usbthumb.
Now I have to show a window or dialog box which should popup
whenever the pen drive is plugged in. I have written a simple
dialog designed using Qt (modal dialog).
To achieve this I added the following lines in /etc/hotplug/usb.agent script at the end of "add)" section:
Quote:
# If the directory was created by automount
if [ -d /home/seran/removable/usbthumb ]
then
# Trying to show dialog
/home/seran/showdialog && mesg "Successfully displayed"
fi
|
But the dialog never appears on screen. I tried using "exec" also, but didn't succeed. The execution of "/home/seran/showdialog" always fails.
I don't understand why this happens?
In short:
A dialog box should appear on screen whenever I plug-in my pendrive.
How do I do this? Any ideas. Please provide some suggestions.
My machine is RedHat 9.0, shell bash.
Thanks
Seran