![]() Registered Member ![]()
|
I need to configure KDE to execute a little script (a message displayed to users) when Storage Media mounts a USB memory drive or CD/DVD. I looked everywhere and cant find it! Is there a way to do this?
Thanks, Daniel |
![]() Administrator ![]()
|
What version of KDE? I do not think you can configure it to run a script, however even with KDE 3. Device notifications are currently unavailable in KDE 4.
Either way, you could write a program that listens for the mounting of devices and then creates a popup, which would get you the functionality required. - If you are using KDE 4, then the programmer can use Solid, which will make the job pretty simple I imagine. - If you are using KDE 3, then you will have to listen to HAL directly, which will make it much harder as HAL sends notifications for any hardware disconnections / connections.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Administrator ![]()
|
I remember there was a way under KDE3. Open KControl, go to "Connected Devices" -> "Storage Media" (or something like that, i don't have the english version at hand).
Now you can add actions depending on the mimetype of the media. So it should be possible to add a shell script as action. But untested as i am not on KDE3 anymore. Hope that helps. |
![]() Registered Member ![]()
|
Thanks for the answers.
I am using 3.5. Tried a new action like suggested, but it replaced the mount with the new action instead of adding the execution of the script to the mount. As for HAL I tried but couldn't find any doc about this solution. Guess I will have to write a little daemon that checks /media and execute the script each time a new mount is made... Other suggestions? Thanks again! Daniel |
![]() Administrator ![]()
|
For documents on HAL see this, could be helpful: http://www.redhat.com/magazine/003jan05/features/hal/
|
Registered users: Bing [Bot], Evergrowing, Google [Bot], rblackwell