Ugly work-around headset notification

Dylan Reilly dreilly at
Sat Sep 6 05:44:28 CEST 2008

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.

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.

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't know about that.


Dylan Maxwell Reilly
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the community mailing list