Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie pajamabama's Avatar
    Join Date
    Jul 2005
    In another time's forgotten space

    script trigger on USB device plug/unplug

    I want to have a script I've created, that selects USB audio as the default alsa device, get triggered automatically when my USB speakers are plugged in (and also when it gets unplugged to reverse it).

    Does anyone know what runs when a USB device is plugged in and how to add my script to that?

    HP Pavilion dv6000t
    Intel Centrino Duo 2.0GHz
    nVidia GeForce Go 7400
    Fedora 10

    The real question is what time is it and why the hell am I still screwing around with my computer?

  2. #2
    i guess that when a device is detected a file descriptor is written in /dev. you could check that in your script and run it. same idea for the reverse part.
    i would do a google search in writing daemons and make one that checks for that fd every x seconds and runs your script as needed.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts