Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

It would be good to know that when you connect a USB device like a web-cam, it notifies me that it works or not.

share|improve this question
9  
Could you please convert your sentence to question :) ? –  João Pinto Nov 24 '10 at 21:05

6 Answers 6

up vote 2 down vote accepted

I have developed an application for this purpose. It shows notifications for many devices (not just Flash Drives and WebCams), and works on Ubuntu 9.04, 9.10, 10.04, 10.10, 11.04 (and derivatives). Its name is udev-notify and you can find more info and packages here: http://udev-notify.learnfree.eu/

share|improve this answer
    
Its really awesome! –  Alaukik May 8 '11 at 9:52
    
It seems the site isn't up? –  NoBugs Jun 7 '12 at 23:27
    
It doesn't seem to work on Ubuntu 12.04 for me, here's bugreport: goo.gl/oLkldr You mentioned that your application supports ubuntu up to 11.04. Do you have any plans to implement 12.04 support? Thanks. –  Dmitry Frank Feb 26 at 8:48
    
Doesn't look like this app will be updated any time soon. Consider it abandoned. –  RolandiXor Jun 2 at 18:25

The libnotify-bin package includes a binary, notify-send which displays a notification. Here's an example of invoking it:

notify-send "New USB device connected" "A new device has been connected: blah blah blah"

I believe you could craft a udev rule for "add" and for "remove" actions to trigger a small script which would invoke a notification. I haven't looked into this but I have seen similar scripts invoking encryption/mouting comands for storage devices.

The Guadalinex project also had this type of functionality[1] which they demo'ed in UDS Seville in 2005 (!), perhaps it would be easier to track down if they submitted their work upstream or if it's available as a separate package somewhere. Do NOT install the packages referred to in the Debian bug I am citing, this is only for reference purposes if anyone would decide to research it.

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=458405

share|improve this answer

For USB Storage devices at least, there is a nifty Indicator:

Granted, that doesn't help much for any device other than those. But i thought I'd mention it. :-)

The project is located here, download the .deb file and just open it to install the application.

share|improve this answer
    
I am assuming hot-pluggable devices aren't shown in that list? –  theTuxRacer Nov 25 '10 at 5:25
    
Link is a 404. It's dead Jim. –  RolandiXor Jun 2 at 18:29

It's really surprizing for me that in 2014 we still don't have this feature working by default. It seems there are very little amount of people who needs this feature, but I really need it.

First of all, I found udev-notify package, but unfortunately it almost doesn't work for me: it works for very little time (1-2 minutes), and then, if I connect/disconnect any device, it crashes:

Traceback (most recent call last):
  File "./udev-notify.py", line 319, in <module>
    notification.show()
glib.GError: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name :1.1061 was not provided by any .service files

I haven't found any solution, so I had to remove it. (filed bugreport also)

There're no similar utilities I've found so far. So I had to implement my own solution, it is probably not brilliant, but it works for me: it notifies me with sound and visual notification for any device that I plug/unplug. Title of the device is received via lsusb, so that if I plug some unknown device, at least I see its vendor_id:product_id. I like it.

It looks like this:

enter image description here

Installation details.

Tested on Ubuntu 12.04, Xubuntu 12.04, Xubuntu 13.04, Linux Mint 13. I believe it should work on other Ubuntu derivatives, and I hope it will work on any *nix system with udev.

  • Go to project page, get sources from there and put them somewhere. There's just one main script in it: my-udev-notify.sh, but archive also contains sounds for plug/unplug notifications, plus some more info, see readme.txt for details.
  • Create file /etc/udev/rules.d/my-udev-notify.rules with the following contents: (don't forget to modify path to your real path where you unpacked my-udev-notify.sh!)

 ACTION=="add",    RUN+="/bin/bash /path/to/my-udev-notify.sh -a add    -p '%p' -b '$attr{busnum}' -d '$attr{devnum}'"
 ACTION=="remove", RUN+="/bin/bash /path/to/my-udev-notify.sh -a remove -p '%p' -b '$attr{busnum}' -d '$attr{devnum}'"

After this, it should work for newly attached devices. That is, if you unplug some device, you won't get notification. But when you plug it back, you will. (yes, for me it works without any udev restarting. If it doesn't for you, try rebooting)

To make it work for all devices, just reboot your system. NOTE that there might be many notifications during first boot (see known issues in the readme.txt). On second boot, there will be no notifications (unless you plug in new device when system is off)

You can customize it (turn on/off visual and sound notifications, or change sounds), check readme.txt in the archive for details.

share|improve this answer

There are applets for the gnome-panel which will let you see plugged in devices and let you eject them. For e.g there is ejecter which is a applet lets you see mounted removable devices and lets you eject them. KDE has a ultra cool notification system letting you see what devices has recently been plugged in. You can try using the lsusb command to check whether your device has been detected or not. And if you are the adventurous type you can write your own udev rules.

share|improve this answer

i dont believe there is such notification yet, (and right now i can't even seem to remember where to set up the notifications) i believe it may be very difficult to make a computer conclude wether or not a webcam works correct.

when you insert a usb device it normally appears on your desktop, i believe you'll have to use the program you are planning to use with your webcam to find out if the webcam actually works.

lets say skype, for an example, you can make a test to see if it works, without calling anybody (options - video devices - (then pretty obvious (that is if i remember it correct)))

i hope this answers your question :-)

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.