So I annoyed myself about this a few days ago when I found myself listening to some music on the 770, had my PSP at home and my iAudio is still being repaired. Having german music blasting out of the headphones when you trying to order a coffe is probably not the best thing, so what to do when you do not have a remote? Try to remove the cover and quickly press stop without unplugging the headphones and treating everyone to a bit of your taste in music. *sigh* Hardly efficient :) Thankfully someone raised a similar question on #maemo earlier today which prompted me to throw together a rather silly script. Unplugging the headphones will set the volume 0 :) (I made it remember the current values aswell, but just to show the person on IRC.) Stupid hack I agree, but I found it quite useful and will promptly put in among the init scripts.
HP="/sys/devices/platform/gpio-switch/headphone/connection_switch" MAIN=0 HEAD=80 while true; do NEW=$(cat $HP) if [ "$OLD" != "$NEW" ]; then if [ "$NEW" = "connected" ]; then gconftool -s /apps/osso/sound/master_volume -t int $HEAD else gconftool -s /apps/osso/sound/master_volume -t int $MAIN fi fi if [ "$NEW" = "connected" ]; then HEAD=$(gconftool -g /apps/osso/sound/master_volume) else MAIN=$(gconftool -g /apps/osso/sound/master_volume) fi OLD=$NEW sleep 1 done