Take the 2-minute tour ×  Is there a headphone daemon for Linux
like there is for maemo? It is really convenient that whenever
you unplug your headphones, the media player automatically stops
playing.  share|improve this question It seems unlikely that
would you describe would actually exist - largely because of the
fact that the kernel probably wouldn't need to know itself. It'd
be a major hack, so I'd be surprised if you find such a thing.
Don't let it stop your trying, though. –  new123456 Mar 30 '11
at 0:18 Maybe a simple program that get list of devices from
PulseAudio, and checks if a new device with type of headphone is
connected, do the job. But how to getting list of PulseAudio
devices (with their types) is the point. –  ilius Jun 11 '11 at
13:36  1 Answer 1  the hda driver, covers most of the new HD
sound cards now has a way to detect plug changes. So if you did
have a newer sound card, an input event happens when ever you
change headphones. An input event could be mapped to a virtual
keypress, such