views:

64

answers:

3

I have a removable device setup so it autoruns when plugged into a Windows machine and pops up a message giving the owner's information, so it can be returned if lost. Is there a way to do this in Linux as well? It doesn't need to be complex, it can be an option in a right-click menu, or a splashscreen, or anything.

A: 

I haven't understood well what you're trying to do, anyway I strongly suggest to use one of the APIs provided by dbus (expecially the hal service).

Though this approach is not immediate.

http://dbus.freedesktop.org/doc/dbus-tutorial.html

pygabriel
I'm trying to create files that enable my external HDD to pop up some kind of message when connected to a computer no matter if it runs on windows or Linux, this is just in case it gets lost someday, I travel a lot and I have lots of important things on my drive, so in case it gets lost I wish there was a way of letting the one who finds it know that I need it and I would like him/her to give it back.
Zloy Smiertniy
+1  A: 

No. Unlike a default installation of Windows, which looks at Autorun.inf and automatically executes a specified program (or at least asks whether the user wants to run the "default action"), no distribution of Linux does this. Any autorun-like feature upon inserting a USB device on Linux must be explicitly set up by the user.

By the way, the autorun "feature" of Windows can be disabled, and it frequently is disabled by security-conscious computer users.

Daniel Trebbien
not disabling autorun is a great way to get viruses from USB keys.
intuited
I'm aware of the possibility of disabling the autorun feature, but most of the computers I work with in college have it enbled, and its most likely that the file will be needed there, thanks :D
Zloy Smiertniy
A: 

I guess you could just put a file in the root directory called README_Owner_Identification.txt. That way people using certain desktop environments would see the filename when the file browser popped up in response to a USB device being automounted. If I recall correctly, both GNOME and KDE will do this by default.

Of course, people would still have to open the file to see the info, and it wouldn't work on systems that have the settings changed, but it's probably your best option. Anything else would require that people engage in some thoroughly insecure system reconfiguration just to see your ID.

intuited