Thursday, September 08, 2011

OpenBSD NC4200: Simple script for audio output swapping for scrotwm.

Heyya,

I've written a simple script to alternate audio out between my laptop speakers and phone out. This script is intended for scrotwm, but also can be used on its own.



As usual, feel free to copy this file and improve it. You can see by the Gist that there's 2 files, the first is .scrotwm.conf and the next one is audioout.sh (see the file name on bottom right of the embed).

The .scrotwm.conf is a snippet of configuration needed to make the script work with scrotwm's key binding. As you can see, I've set the key binding to Mod+Shift+a key. So whenever I press the key binding, the audio output will swap between speaker and phone out. Very simple. All I need to do is add the snippet to ~/.scrotwm.conf.

Then I need to save the 2nd file as audioout.sh and save it in /usr/local/share/scrotwm/. There's a few other default scrotwm's script inside there. Make sure the audioout.sh is executable, if not do chmod 755 or similar which is suitable for your environment. Then enjoy.

Previously I would need to manually mute/unmute both master and phone out as I sometime uses headphone. Now I can simply press Mod+Shift+a to swap between it.

Take note that this script can be used even without scrotwm. You just need to copy the 2nd file to your ~/ (home) and run it by typing ./audioout.sh or use another keybinding if available. Later.

No comments:

6.5 amd64: Modify existing certbot certificates.

Hi, It's been quite some time eh. As you can see, I still upgrade my OpenBSD system regularly but currently I do not have the time to ...