That's a very good idea, and I would like to help you ... but the inner workings of udev are "black magic" to me.can8v wrote:my initial idea is that I could use udev rules to detect my Nexus 7 connection via USB, when it is detected then run a script that will mount the Nexus 7 via go-mtpfs.
Let me say that, in principle, what you need is some form of udev rule which will identify any/all MTP devices which may be connected to Puppy, then launch the appropriate go-mtpfs commands.can8v wrote:Even if I figure out this udev rule, this is not very universal and would require anybody doing this to customize the script ...
... and change the udev rule to detect their device instead of a Nexus 7
What may assist you is the MTP udev rule from gnomad2, which I now attach. As you can see, it contains a long list of USB device ID's of known MTP devices.
But here's another idea you may like - what about a bash wrapper script which does the following:
- launches go-mtpfs
- launches ROX, to the directory specified by go-mtpfs (/root/MTP by my suggestion)
- the wrapper script determines when ROX is closed, then ...
- unmounts the device (with fusermount)
- displays a message - probably via gtkdialog, saying something like
"your MTP device has been unmounted, and is now safe to disconnect"
BE CAREFUL ... the expression which follows "go-mtpfs" defines the directory where the (FUSE) mountpoint is located - so you have specified a Linux directory which includes a space - and that's problematic in Linux.can8v wrote:Code: Select all
go-mtpfs "Nexus 7" &