Created
September 8, 2011 03:33
-
-
Save alsemo/1202541 to your computer and use it in GitHub Desktop.
/usr/local/share/scrotwm/audioout.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # My scrotwm config | |
| # Programs | |
| program[swap_audio] = /usr/local/share/scrotwm/audioout.sh | |
| # Key Bindings | |
| bind[swap_audio] = MOD+Shift+a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # | |
| # audioout.sh - Ahmad Zulkarnain 08/09/11 | |
| # Script to alternate between audio master output and phone output. | |
| # Will be used by scrotwm. Copy to /usr/local/share/scrotwm/ | |
| # and alter ~/.scrotwm.conf accordingly. | |
| # Variables for audio status | |
| master=$(mixerctl | grep master.mute | sed s/.*=//) | |
| phout=$(mixerctl | grep phone.mute | sed s/.*=//) | |
| # Program starts | |
| if [[ $master == 'on' ]]; | |
| then | |
| mixerctl outputs.master.mute=off; | |
| mixerctl outputs.hp.mute=on; | |
| elif [[ $phout == 'on' ]]; | |
| then | |
| mixerctl outputs.master.mute=on; | |
| mixerctl outputs.hp.mute=off; | |
| else | |
| mixerctl outputs.master.mute=off; | |
| mixerctl outputs.hp.mute=on; | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment