Jul 5, 2012

kmix: Automatically switch "Master Channel" between devices

Keywords:  bash, KDE 4, kmix, select Master Channel, automatic
Depends on:  kmix
Download:  kmix_set_master

Like nearly all laptops, I have a built-in MIC and speakers.  When I skype, I prefer to use my wireless USB headset.

KDE provides global shortcuts which allow you to bind your keyboard's volume up/down/mute keys.  In turn, the requests are handed to kmix.  kmix dutifully obeys the commands but only for the currently selected Master Channel (in kmix, see Settings > Select Master Channel ...).

What I wanted is kmix to automagically set the master channel to my headset when plugged in and when it's not, revert back to the integrated device.

I asked on IRC, checked Google but came up empty.  I wrote a simple shell script which starts at KDE login to monitor when I plug in my headset.  When it detects it's been plugged in, it uses qdbus to instruct kmix to switch its master channel.

The script has set up instructions.

The script cites the following excellent URL which enabled me to write the qdbus call:  http://usrlocalbin.blogspot.ca/2008/04/qdbus-tutorial-part-one.html

Slight Bug
With my wireless headset, the above script switches the master channel when the USB clip is connected.  The headset does not have to be turned on.  This might be a slight annoyance to people.  :)

If this becomes a problem, I'll see if there's an additional Linux status provided when the USB clip makes contact to the headset.

HOWTO: naked domains and Google Sites

Google states you can't set up a naked domain with Google Sites.  I found you can and I'll tell you how.

First, a naked domain is when someone enters as a URL, just the domain (e.g. blueoakdb.com) and you'd like it to map to www.blueoakdb.com

While it's true you cannot set up an @ CNAME record, you can set up a Web Forwarder using an @.  By so doing, you emulate a naked domain.  :)

Test it out,  http://blueoakdb.com goes to http://www.blueoakdb.com