Hi, "pasuspender" does not always work correctly. I wrote a wrapper "amsn" which
KILLS (not suspend) pauseaaudio and resumes after amsn finsiehs. This works 
better
than pasuspender for me.

#!/bin/sh

MYUNAME=`id | sed -e 's/^[^(]*(\([^)]*\)).*$/\1/'`; export MYUNAME

PATH=`\`dirname $0\`/setbinpath amsn 2> /dev/null`:`echo :$PATH: | sed
-e "s@:\`dirname $0\`:@:@g" -e "s/^://" -e "s/:$//"`; export PATH

# === Functions Start ===

#
# Which (avoids buggy csh version)
#
which() {
  for DIR in `echo $PATH | sed -e "s/:/ /g"`; do
    if [ -x "$DIR/$1" -a ! -d "$DIR/$1" ]; then
      echo "$DIR/$1" | sed -e "s@//*@/@g"; return
    fi
  done
}

# === Functions End ===

if [ ! "`which amsn`" ]; then
  echo "***ERROR*** Cannot find required \"amsn\" utility." 1>&2; exit 1
fi

if [ "`ps -u $MYUNAME | grep \" pulseaudio$\"`" ]; then
  killall pulseaudio > /dev/null 2>&1; (amsn "$@"; pulseaudio > /dev/null 2>&1) 
&
else
  amsn "$@" &
fi

-- 
Default ALSA device must use PulseAudio, otherwise ALSA applications may fail
https://bugs.launchpad.net/bugs/198453
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to