-
-
Save jtmitchell/d68c65996ee5d477a544 to your computer and use it in GitHub Desktop.
A script that reads a defaults file which has the pulseaudio device name, and your username in it. Use this to make your webcam the default input when you plug it in.
This file contains 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/bash | |
# | |
# Setup the webcam mic for pulseaudio | |
# | |
WEBCAM_MIC="" | |
WEBCAM_USER="" | |
[ -r /etc/default/webcam-mic ] && source /etc/default/webcam-mic | |
[ -z "$WEBCAM_MIC" ] && exit 1 | |
[ -z "$WEBCAM_USER" ] && exit 1 | |
logger -t WEBCAM "set mic to $WEBCAM_MIC for $WEBCAM_USER" | |
(sleep 1s; su "$WEBCAM_USER" -c "pacmd set-default-source $WEBCAM_MIC")& | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use this in conjunction with UDEV rules to set a USB webcam as the default input.
http://askubuntu.com/a/115575/44766
The config in /etc/default/webcam-mic is just so you can define the id for the webcam and your user name.
it just needs the 2 lines
WEBCAM_MIC="alsa_input.usb-Microsoft_Microsoft___LifeCam_VX-5500-02-VX5500.analog-mono"
WEBCAM_USER="james"