Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm in a ssh connection and I would like to play a sound after a command completes (not on the server where I connected).

Something:

ssh me@somewhere.com
make && play-sound-local

I have built-in pc-speaker disabled so echo -e "\a" doesn't work.

Any suggestions?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

You can configure PulseAudio to allow network connections, then use ssh port forwarding and paplay -s on the remote side to send audio back through the ssh connection. Note that the audio may be delayed or stutter based on the fidelity of the audio and the speed of the connection.

share|improve this answer

Set up primitive server (for example, on port 1234) that plays sound on local computer when someone connects, and forward that port to remote server.

On local machine:

nc -l -p 1234 -e "mplayer sound.ogg"

then

ssh -L 1234:localhost:12345 me@somewhere.com
make && nc localhost 12345

PS: you should use ; instead of && if you want to be notified even when make failed.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.