falconindy / ponymix

CLI volume control for PulseAudio
MIT License
177 stars 27 forks source link

Control all devices? #48

Open WhyNotHugo opened 7 years ago

WhyNotHugo commented 7 years ago

I'd like to mute/unmute all microphones together (the same applies to volume control, etc).

Right now, this does not seem to be trivially possible. I need to wrap ponymix and:

An --all-cards flag that does this (rather than just work on the default one) would be really really useful.

WhyNotHugo commented 5 years ago

I'm using this bash script as a workaround, for anybody interested.

#!/bin/sh

set -x
set -e

if [ -z $1 ]; then
  true
elif [ $1 == decrease ]; then
  COMMAND="decrease 3"
elif [ $1 == increase ]; then
  COMMAND="increase 3"
elif [ $1 == min ]; then
  COMMAND="set-volume 0"
elif [ $1 == max ]; then
  COMMAND="set-volume 100"
elif [ $1 == toggle ]; then
  COMMAND="toggle"
else
  echo "Bad argument"
  exit -1
fi

if [ -z "$COMMAND" ]; then
  true  # No command to run
else
  for dev in $(ponymix --sink --short list | cut -f 3); do
    ponymix -d $dev $COMMAND
  done
fi
mindrunner commented 1 year ago

For me, your script mutes all sinks. To mute all sources (microphones), I use:

for dev in $(ponymix --source --short list | cut -f 3); do
  ponymix --source -d $dev mute
done