Score:1

How to play sound when a device is unplugged from USB or audio jack?

ai flag

In need of a software or a command that plays an alarming sound when a device is unplugged from the USB port or audio jack.

Bonus Joke-(Need that for international security purposes)

cn flag
A possible approach would be a small script that plays some sound, and then call that script in an Udev rule that reacts to the removal of the device in question. See for example [here](https://www.thegeekdiary.com/how-to-run-a-script-when-usb-devices-is-attached-or-removed-using-udev/). I'm not sure whether Udev manages audio jacks, as well. And if "international security purposes" mean stuff like formal audits, that may well be a whole different can of worms.
br flag
What's your Operating System??
Kushagra Srivastava avatar
ai flag
sir, i am asking on askubuntu so i would surely be on ubuntu
Kushagra Srivastava avatar
ai flag
@HenningKockerbeck understood nothing sir
cn flag
Ubuntu manages at least some devices connected to it with a system called [udev](https://en.wikipedia.org/wiki/Udev). Among other things, you can use so called _udev rules_ to define that a specific command should be executed, every time a specific device is connected to the system or is disconnected from it. So you could write a small script that plays some sound, and have that script execute when the device in question is connected or disconnected. But I don't know whether udev handles the audio jack, and I don't know whether this approach would be secure enough for your purposes.
Kushagra Srivastava avatar
ai flag
thanks sir. would be great if someone gives the commands too as i am not a linux pro.... sad noise.........
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.