Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I thought it would be fun to play a sound when connecting to a network of some sort (wireless or otherwise), kind of like the dial-up sounds of yesteryear.

EDIT: Clarification: when connecting to the network, so the sound starts playing when the connection attempt is initiated, and stops when the connection is successfully established

A google doesn't bring up anything obvious..

Any ideas? (I'm willing to [attempt to] write a plugin or something, if someone could point me in the right direction)

share|improve this question
up vote 2 down vote accepted

For example, if you are using a mechanism such as /etc/network/interfaces (in Debian and its derivatives) to bring network interfaces up, you can launch a script with the pre-up hook, and kill the script with the post-up hook. This script would generate sound continuously, probably by playing a sound file in a loop.

I'm not aware if there is a way to attach commands to more high level systems like Network Manager.

share|improve this answer
About the high-level systems, the Network Manager's DBUS API has signals that you could hook onto (C example; many more)‌​. That said, your desktop environment might already provide the means for that (e.g. KDE: System Settings -> Notifications -> Source: Network Mgmt) – sr_ Sep 21 '12 at 6:49
You can also write a script to go in /etc/NetworkManager/dispatcher.d. See NetworkManager(8) for more details. – Jim Paris Sep 21 '12 at 16:29

Your Answer


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.