public
Created

Galaxy Nexus MTP Mount

  • Download Gist
gnexmtp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
##/etc/udev/rules.d/95-galaxy-nexus.rules
 
#Action on Galaxy Nexus Connect
SUBSYSTEMS=="usb", ATTRS{serial}=="014E058C0E010016", KERNEL=="1-1", SYMLINK+="galaxy-nexus", RUN+="/home/david/.bin/root-to-david"
 
 
##~/.bin/root-to-david
#!/bin/bash
 
su david /home/david/.bin/galaxy-nexus
 
 
##~/.bin/galaxy-nexus
#!/bin/bash
 
# Set up a user environment
su david
export DISPLAY=:0
export HOME=/home/david/
export PATH=/bin:/sbin:/usr/bin:/usr/sbin
 
# Run if user hits control-c
control_c()
{
echo -en "\n*** Exiting ***\n"
killall yad
exit $?
}
# Make a FIFO pipe to send commands to yad.
PIPE=$(mktemp -u --tmpdir ${0##*/}.XXXXXXXX)
mkfifo $PIPE
exec 3<> $PIPE
function on_exit () {
echo "quit" >&3
rm -f $PIPE
}
trap on_exit EXIT
 
# trap keyboard interrupt (control-c)
trap control_c SIGINT
 
kdialog --passivepopup "Your Galaxy Nexus is ready to be mounted!" 5 --title "<b>Google Galaxy Nexus</b>" --icon "google-play"
 
yad --text="Galaxy Nexus" --notification="Google Galaxy Nexus" --kill-parent --listen --command="brocket -c 'konsole' 'My Tasks - Google Tasks'" --image="google-play" <&3 &
 
echo "menu: Quit!quit!application-exit|Unmount!fusermount -u /home/david/Android/!emblem-unmounted|Open Folder!dolphin '/home/david/Android/Internal storage'!system-file-manager|Mount!jmtpfs /home/david/Android/!emblem-mounted" >&3
 
while [ -a /dev/galaxy-nexus ] ; do
sleep 1
done

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.