mirror of
https://github.com/vincentbernat/i3wm-configuration.git
synced 2025-07-30 15:55:05 +02:00
i3: make toggle-mute display final status
This commit is contained in:
parent
9db9cab487
commit
a74ca20c36
1 changed files with 2 additions and 0 deletions
|
@ -7,6 +7,7 @@ case $1 in
|
|||
pactl list ${1}s \
|
||||
| awk '/^(Source|Sink) / { source=substr($2,2) }
|
||||
/^\tName: .*.monitor$/ { source=0 }
|
||||
/^\tDescription: / { sub("^[^:]*: ", ""); descriptions[source] = $0 }
|
||||
/^\tMute: / { if (source > 0) muted[source] = ($2 == "yes") }
|
||||
END {
|
||||
if (length(muted) == 0) exit;
|
||||
|
@ -17,6 +18,7 @@ case $1 in
|
|||
}
|
||||
}
|
||||
for (source in muted) {
|
||||
print "echo "(allmuted?"🔊":"🔇")" "descriptions[source]
|
||||
print "pactl set-'$1'-mute "source" "(!allmuted);
|
||||
}
|
||||
}' \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue