<div dir="ltr">I propose the this script [1] as a work-around for the lack of correctly working headset insertion detection. This should be coupled with a alsa state file that correctly disables the external speaker, like [2]. This is an ugly script and has two major failings so use with caution. Upon receiving a dbus message, the script will store the current state to a temp file and load your new state. When the headphone is unplugged, it loads the temp state back.<br>
<br>1) It is a shell script parsing dbus-monitor which is horribly inefficient. Moreover, dbus-monitor does not properly shutdown when the script is terminated. A wise person would have writen this in C or python but I am lazy and dislike python.<br>
<br>2) While headset insertion does register a dbus message, there is no difference between inserted and removed states. Perhaps that is why this whole thing is busted in the first place? Therefore, if you have the headphones in when this script is started it won&#39;t know about that.<br>
<br>[1] <a href="http://atariland.net/~dreilly/openmoko/headset-watcher">http://atariland.net/~dreilly/openmoko/headset-watcher</a><br>[2] <a href="http://atariland.net/~dreilly/openmoko/headphones.state">http://atariland.net/~dreilly/openmoko/headphones.state</a><br>
<br><br>-- <br>Dylan Maxwell Reilly<br>
</div>