MTP automatic mounter (CLOSED)
Posted: Thu 30 Jan 2014, 07:26
***EDIT***
I have abandoned this project in favor of a completely different design. The new package is posted here: http://murga-linux.com/puppy/viewtopic. ... 455#756455
The PET package I posted in this thread does work and some might prefer it, but since I have abondoned it, I will not be supporting it, or coming out with any now feature releases or bug fixes (if there are any bugs). I have marked this thread, as CLOSED, Should somebody else wish to pursue further development on this project that would be fine by me, but a new thread should be opened.
***END EDIT***
This is a distro independent package (bash shell scripts) for auto mounting MTP devices, such as Android 4.x and up and many media players. You will need to install the go-mtpfs package from tempestuous available here:
http://murga-linux.com/puppy/viewtopic. ... 442#752416
These scripts make extensive use of notify-send, so libnotify is highly recommended. I suppose one could use this package without notifications, but you might run into some unexpected behavior that the notifications would explain to you and keep you from thinking there is a bug where there probably isn't. If you don't have/want notify-send I recommend launching the scripts from the command line, as some of the notifications also echo to the terminal.
I built this program because there is an issue with udev in some puppies (all versions of Saluki and Carolina and at least some versions of Fat Dog 64, and maybe others) that causes 01micko's excellent auto mounter to take 20-30 seconds to autodetect a connection to a MTP device. Since I use Carolina that is why all the notifications use notify-send. for ver. 0.2 I will try to automatically detect if notify-send is available and if it is not, then use GtkDialog instead. That is assuming we run into some folks using puppies that don't have notify-send and want to use this package.
Usage:
After installing Tempestuous' go-mtpfs package and this package, then you need to decide how you would like to launch the scripts.
I chose to make a custom action in Thunar file manager, this makes a right click context menu item. You can do this as follows.
Open Thunar -> Edit -> create custom action
the scripts will have been installed in the /root/my-applications/bin directory the mount script is mountMTP.sh and the unmount script is unmountMTP.sh
You can simply navigate to them in a file manager and open them, or you can create symlinks on your desktop, create menu entries, etc.
The important thing here is that after you mount a MTP device the first time there is a monitor script that will continuously monitor your USB ports waiting for the next time you plug it in and when you do it will recognize it as your MTP device and automount it. When you are done with it just unmount it using the unmount script. It is important that if you use the mount script to mount it or you auto-mount it that you use the unmountMTP.sh script to unmount it. If you mount from the terminal using go-mtpfs directly from the terminal then you will need to unmount directly from the terminal. That said if you like the command line, that is another option for using these scripts.
simply install the packages, plug in your device and at the command line type:
# mountMTP.sh
The automount magic needs the USB monitor to be started. it is in the /root/Startup directory and will start automatically every time you start your computer, but unless you just happened to restart your computer after you installed the package, you will need to manually start the monitor this time. You can start it at the command line by typing:
# dmesgParse.sh
or you can simply navigate to /root/Startup in your file manager and double click the file.
When you are ready to unmount your device just launch the unmountMTP.sh script by any method you like. at the command line it is
# unmountMTP.sh
That's it. Enjoy!
Report any bugs or suggestions here. I am plan at least one more version after this, maybe more, who knows.
[/img]
I have abandoned this project in favor of a completely different design. The new package is posted here: http://murga-linux.com/puppy/viewtopic. ... 455#756455
The PET package I posted in this thread does work and some might prefer it, but since I have abondoned it, I will not be supporting it, or coming out with any now feature releases or bug fixes (if there are any bugs). I have marked this thread, as CLOSED, Should somebody else wish to pursue further development on this project that would be fine by me, but a new thread should be opened.
***END EDIT***
This is a distro independent package (bash shell scripts) for auto mounting MTP devices, such as Android 4.x and up and many media players. You will need to install the go-mtpfs package from tempestuous available here:
http://murga-linux.com/puppy/viewtopic. ... 442#752416
These scripts make extensive use of notify-send, so libnotify is highly recommended. I suppose one could use this package without notifications, but you might run into some unexpected behavior that the notifications would explain to you and keep you from thinking there is a bug where there probably isn't. If you don't have/want notify-send I recommend launching the scripts from the command line, as some of the notifications also echo to the terminal.
I built this program because there is an issue with udev in some puppies (all versions of Saluki and Carolina and at least some versions of Fat Dog 64, and maybe others) that causes 01micko's excellent auto mounter to take 20-30 seconds to autodetect a connection to a MTP device. Since I use Carolina that is why all the notifications use notify-send. for ver. 0.2 I will try to automatically detect if notify-send is available and if it is not, then use GtkDialog instead. That is assuming we run into some folks using puppies that don't have notify-send and want to use this package.
Usage:
After installing Tempestuous' go-mtpfs package and this package, then you need to decide how you would like to launch the scripts.
I chose to make a custom action in Thunar file manager, this makes a right click context menu item. You can do this as follows.
Open Thunar -> Edit -> create custom action
the scripts will have been installed in the /root/my-applications/bin directory the mount script is mountMTP.sh and the unmount script is unmountMTP.sh
You can simply navigate to them in a file manager and open them, or you can create symlinks on your desktop, create menu entries, etc.
The important thing here is that after you mount a MTP device the first time there is a monitor script that will continuously monitor your USB ports waiting for the next time you plug it in and when you do it will recognize it as your MTP device and automount it. When you are done with it just unmount it using the unmount script. It is important that if you use the mount script to mount it or you auto-mount it that you use the unmountMTP.sh script to unmount it. If you mount from the terminal using go-mtpfs directly from the terminal then you will need to unmount directly from the terminal. That said if you like the command line, that is another option for using these scripts.
simply install the packages, plug in your device and at the command line type:
# mountMTP.sh
The automount magic needs the USB monitor to be started. it is in the /root/Startup directory and will start automatically every time you start your computer, but unless you just happened to restart your computer after you installed the package, you will need to manually start the monitor this time. You can start it at the command line by typing:
# dmesgParse.sh
or you can simply navigate to /root/Startup in your file manager and double click the file.
When you are ready to unmount your device just launch the unmountMTP.sh script by any method you like. at the command line it is
# unmountMTP.sh
That's it. Enjoy!
Report any bugs or suggestions here. I am plan at least one more version after this, maybe more, who knows.
[/img]