Last active
January 9, 2022 16:58
-
-
Save fmartins-andre/246cb6b3801700963ef5367a0a74b0ac to your computer and use it in GitHub Desktop.
Toggle microfone capture ON/OFF using command line. Useful with keyboard shortcut.
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
### reference: https://askubuntu.com/a/576507 | |
on=/usr/share/icons/Adwaita/48x48/status/microphone-sensitivity-high-symbolic.symbolic.png | |
off=/usr/share/icons/Adwaita/48x48/status/microphone-disabled-symbolic.symbolic.png | |
amixer set Capture toggle \ | |
&& amixer get Capture | grep '\[off\]' \ | |
&& notify-send "Mic switched OFF" "Mic capture was disabled!" --icon=$off \ | |
|| notify-send "Mic switched ON" "Mic capture was enabled!" --icon=$on |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment