summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzachir <zachir@librem.one>2021-01-31 22:57:31 -0600
committerzachir <zachir@librem.one>2021-01-31 22:57:31 -0600
commit0a773e03f44107201f5c14b4a830949abc0ee6a4 (patch)
treee42c8b6f9fcbd178798ac272451dc5809a450bf4
parentb2d4a269084c955ba27876b93cfc2cf915b0d8b7 (diff)
Add support to mute ALSA microphone
-rw-r--r--README.md7
-rwxr-xr-xvolsv1
2 files changed, 3 insertions, 5 deletions
diff --git a/README.md b/README.md
index e139145..49ae925 100644
--- a/README.md
+++ b/README.md
@@ -7,11 +7,11 @@ Volsv is a POSIX-compliant shell script I wrote in 2020, and have been modifying
- Increasing volume
- Decreasing volume
- Toggling the interface mute
-- Toggling the microphone mute\*
+- Toggling the microphone mute
- Getting the volume
- Getting the mute state
-in both pulseaudio and ALSA\*. Once I get OpenBSD and FreeBSD up and running, I will add those sound options too.
+in both pulseaudio and ALSA. Once I get OpenBSD and FreeBSD up and running, I will add those sound options too.
It depends on:
@@ -32,6 +32,3 @@ I made volsv so that I could use it with keybindings to control the volume, rega
- get volume level: `getv` or `-v`
- get mute state: `getm` or `-g`
-
-
-\*Volsv does not yet support muting the microphone in ALSA.
diff --git a/volsv b/volsv
index 489e372..2969963 100755
--- a/volsv
+++ b/volsv
@@ -25,6 +25,7 @@ alsasv () {
"up" | "-i") amixer sset Master 5%+ ;;
"down" | "-d") amixer sset Master 5%- ;;
"toggle" | "-t") amixer sset Master toggle ;;
+ "mic" | "-m") amixer sset Capture toggle ;;
"getv" | "-v") amixer sget Master | grep '\[[0-9]*\%\]' | cut -d' ' -f6 | sed 's/\[//;s/\]//g' ;;
"getm" | "-g") amixer sget Master | grep '\[o[fn]' | cut -d' ' -f8 | head -1 ;;
*) printerror "$1" ;;