The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   UNIX - General (http://hintsforums.macworld.com/forumdisplay.php?f=16)
-   -   Launch script when USB device is plugged in (http://hintsforums.macworld.com/showthread.php?t=103742)

tw 07-24-2009 12:38 AM

ok, I think I've found a promising direction for this (plus I learned something cool in the process). I got thinking about baf's comment about Linux and inotifywait and started checking man pages about notifications; what I found was notifyd and notifyutil. notifyd is the notifications server for the system - it sends out all the notifications of system events for other applications to pick up. notifyutil is a tool for interacting with notifyd. you can use it to register apps to receive particular notifications, and even to send notifications of your own out to the rest of the system. this article gives an overview, and tells you how to put notifyd into debug mode so you can log notifications and figure out what they are; this one is developer-level documentation on the notifications system.

you ought to be able to use this to catch the 'mount device' event, though (since I don't have your device) I can't help you figure out what the notification key is.


All times are GMT -5. The time now is 05:31 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.