Created
November 8, 2015 14:11
-
-
Save alan-mushi/0949f12fd82bb042a02d to your computer and use it in GitHub Desktop.
Revisions
-
alan-mushi created this gist
Nov 8, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ #!/bin/bash # This simple helper script toggle the mute attribute for a program in pulseaudio. PROG="Chromium" all=$(pacmd list-sink-inputs | egrep -B 15 "client: [0-9]+ <${PROG}>" | sed -n '1p;8p') index=${all:11:2} # get the index muted=${all:22:3} # get 'yes' or 'no' echo "[~] Pulseaudio on ${PROG}:" echo -e "\tindex: ${index:-index not set}" echo -e "\tmuted: ${muted:-muted not set}" if [ "$muted" == "yes" ] ; then echo "[*] ${PROG} is detected as mute, let's change that" pacmd set-sink-input-mute $index false else echo "[-] ${PROG} not found or already unmuted" fi