Warning: this is an htmlized version!
The original is here, and
the conversion rules are here.
#######
#
# E-scripts on the MTP filesystem (mainly for Android) and fuse.
#
# Note 1: use the eev command (defined in eev.el) and the
# ee alias (in my .zshrc) to execute parts of this file.
# Executing this file as a whole makes no sense.
# An introduction to eev can be found here:
#
#   (find-eev-quick-intro)
#   http://angg.twu.net/eev-intros/find-eev-quick-intro.html
#
# Note 2: be VERY careful and make sure you understand what
# you're doing.
#
# Note 3: If you use a shell other than zsh things like |&
# and the for loops may not work.
#
# Note 4: I always run as root.
#
# Note 5: some parts are too old and don't work anymore. Some
# never worked.
#
# Note 6: the definitions for the find-xxxfile commands are on my
# .emacs.
#
# Note 7: if you see a strange command check my .zshrc -- it may
# be defined there as a function or an alias.
#
# Note 8: the sections without dates are always older than the
# sections with dates.
#
# This file is at <http://angg.twu.net/e/mtp.e>
#           or at <http://angg.twu.net/e/mtp.e.html>.
#        See also <http://angg.twu.net/emacs.html>,
#                 <http://angg.twu.net/.emacs[.html]>,
#                 <http://angg.twu.net/.zshrc[.html]>,
#                 <http://angg.twu.net/escripts.html>,
#             and <http://angg.twu.net/>.
#
#######




# «.jmtpfs»		(to "jmtpfs")
# «.fuse»		(to "fuse")
# «.mtp-tools»		(to "mtp-tools")
# «.gvfs-backends»	(to "gvfs-backends")
# «.the-.gvfs-file»	(to "the-.gvfs-file")
# «.ls»			(to "ls")
# «.simple-mtpfs»	(to "simple-mtpfs")
# «.adb»		(to "adb")
# «.mtpfs-jan2022»	(to "mtpfs-jan2022")
# «.screenshots»	(to "screenshots")




#####
#
# jmtpfs
# 2017ago08
#
#####

# «jmtpfs» (to ".jmtpfs")
# (find-status   "jmtpfs")
# (find-vldifile "jmtpfs.list")
# (find-udfile   "jmtpfs/")
# (find-man "1 jmtpfs")
# (find-sh "jmtpfs -h")
# (find-sh "jmtpfs -V")
# (find-sh "jmtpfs -l")




#####
#
# fuse
# 2017ago08
#
#####

# «fuse» (to ".fuse")
# (find-status   "fuse")
# (find-vldifile "fuse.list")
# (find-udfile   "fuse/")
# (find-man "8 mount.fuse")
# (find-man "1 fusermount")
# (find-man "1 ulockmgr_server")

fusermount    ~/Android/
fusermount -u ~/Android/








#####
#
# mtp-tools
# 2017ago08
#
#####

# «mtp-tools» (to ".mtp-tools")

apti mtp-tools mtpfs

# (find-status   "mtp-tools")
# (find-vldifile "mtp-tools.list")
# (find-udfile   "mtp-tools/")
# (find-status   "mtpfs")
# (find-vldifile "mtpfs.list")
# (find-udfile   "mtpfs/")

# (find-man "1 mtpfs")
# (find-man "1 mount.mtpfs")
# (find-sh "mtpfs -h")
# LIBMTP ERROR: couldnt parse extension samsung.com/devicestatus:1
#  -> https://sourceforge.net/p/libmtp/bugs/1593/

# (find-man "1 mtp-tools")
# (find-man "1 mtp-albumart")
# (find-man "1 mtp-albums")
# (find-man "1 mtp-connect")
# (find-man "1 mtp-delfile")
# (find-man "1 mtp-detect")
# (find-man "1 mtp-emptyfolders")
# (find-man "1 mtp-files")
# (find-man "1 mtp-filetree")
# (find-man "1 mtp-folders")
# (find-man "1 mtp-format")
# (find-man "1 mtp-getfile")
# (find-man "1 mtp-getplaylist")
# (find-man "1 mtp-hotplug")
# (find-man "1 mtp-newfolder")
# (find-man "1 mtp-newplaylist")
# (find-man "1 mtp-playlists")
# (find-man "1 mtp-reset")
# (find-man "1 mtp-sendfile")
# (find-man "1 mtp-sendtr")
# (find-man "1 mtp-thumb")
# (find-man "1 mtp-tracks")
# (find-man "1 mtp-trexist")

# Unable to read MTPZ public exponent from ~/.mtpz-data, MTPZ disabledlibmtp version: 1.1.6
# https://sourceforge.net/p/libmtp/bugs/968/

mtp-folders




#####
#
# gvfs-backends
# 2017ago08
#
#####

# «gvfs-backends» (to ".gvfs-backends")
# (find-status   "gvfs-backends")
# (find-vldifile "gvfs-backends.list")
# (find-udfile   "gvfs-backends/")





#####
#
# the ~/.gvfs file
# 2017ago09
#
#####

# «the-.gvfs-file» (to ".the-.gvfs-file")
# https://askubuntu.com/questions/492813/what-is-the-gvfs-file
# https://askubuntu.com/questions/211414/where-did-gvfs-go-on-ubuntu-12-10
# https://unix.stackexchange.com/questions/77453/why-cannot-find-read-run-user-1000-gvfs-even-though-it-is-running-as-root
# http://www.linuxquestions.org/questions/linux-software-2/what-is-gvfs-weird-directory-entry-4175477518/



#####
#
# ls problems
# 2017ago08
#
#####

# «ls» (to ".ls")
# (find-zsh "cd; laf | grep And")
# ls: cannot access .gvfs: Permission denied
# ls: cannot access Android: Input/output error
# d?????????   ? ?    ?           ?            ? Android/




#####
#
# simple-mtpfs
# 2017ago09
#
#####

# «simple-mtpfs» (to ".simple-mtpfs")
# https://aur.archlinux.org/packages/simple-mtpfs/
# https://github.com/phatina/simple-mtpfs
# https://github.com/phatina/simple-mtpfs/wiki
# (find-git-links "https://github.com/phatina/simple-mtpfs" "simplemtpfs")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
rm -Rfv ~/usrc/simple-mtpfs/
cd      ~/usrc/
git clone https://github.com/phatina/simple-mtpfs
cd      ~/usrc/simple-mtpfs/

autoconf    |& tee oa
./configure |& tee oc
make |& tee om
make install

# git pull
# (find-fline "~/usrc/")
# (find-fline "~/usrc/simple-mtpfs/")

# (code-c-d "simplemtpfs" "~/usrc/simple-mtpfs/")
# (find-simplemtpfsfile "")
# (find-gitk "~/usrc/simple-mtpfs/")




#####
#
# adb
# 2017ago13
#
#####

# «adb» (to ".adb")
# (find-es "android" "adb-shell")




#####
#
# mtpfs-jan2022
# 2022jan01
#
#####

# «mtpfs-jan2022»  (to ".mtpfs-jan2022")
# (find-es "android" "automount-2021")
# https://askubuntu.com/questions/342319/where-are-mtp-mounted-devices-located-in-the-filesystem/719941#719941
# (find-zsh "installeddebs | sort | grep mtp")
# (find-zsh "availabledebs | sort | grep mtp")
# (find-status   "go-mtpfs")
# (find-vldifile "go-mtpfs.list")
# (find-udfile   "go-mtpfs/")
# (find-status   "mtp-tools")
# (find-vldifile "mtp-tools.list")
# (find-udfile   "mtp-tools/")
# (find-status   "jmtpfs")
# (find-vldifile "jmtpfs.list")
# (find-udfile   "jmtpfs/")

# (find-man "1 go-mtpfs")
# (find-man "1 jmtpfs")

# (find-sh "go-mtpfs")
# (find-sh "go-mtpfs -h")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
sudo apt-get install go-mtpfs
sudo apt-get install jmtpfs
sudo apt-get install mtp-tools

* (eepitch-shell2)
* (eepitch-kill)
* (eepitch-shell2)
sudo mkdir -p  /media/mtp/phone
sudo chmod 775 /media/mtp/phone
# Unplug the phone micro-USB and plug-in, then...
sudo go-mtpfs -allow-other /media/mtp/phone
ls -lt         /media/mtp/phone/

sudo go-mtpfs -allow-other /media/mtp/phone
ls -lt         /media/mtp/phone/

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
ls -lt         /media/mtp/phone/
find           /media/mtp/phone/

# (find-sh "find /media/mtp/phone/")

# (find-man "1 fusermount")
# (find-sh "fusermount -h")
# (find-sh "mount")
sudo fusermount -u /media/mtp/phone/
sudo umount        /media/mtp/phone

# (find-fline "/media/mtp/phone/")
# (find-fline "/media/mtp/phone/Phone/DCIM/")
# (find-fline "/media/mtp/phone/Phone/Movies/")
# (find-fline "/media/mtp/phone/Tablet/Movies/")

jmtpfs
jmtpfs -l
jmtpfs -h
# (find-sh "jmtpfs -h")

sudo jmtpfs -o allow_other /media/mtp/phone

# (find-fline "/media/mtp/phone/")


# (find-sh "sudo ps ax")



#####
#
# screenshots
# 2023feb17
#
#####

# «screenshots»  (to ".screenshots")
# (find-efunction 'find-mtp-links)

* (eepitch-shell2)
* (eepitch-kill)
* (eepitch-shell2)
# (find-fline "/media/mtp/phone/")

sudo fusermount -u /media/mtp/phone/
sudo umount        /media/mtp/phone
sudo mkdir -p      /media/mtp/phone
sudo chmod 775     /media/mtp/phone

# Connect the phone to the computer, then:
sudo go-mtpfs -allow-other /media/mtp/phone

# "Allow the phone to access phone data?" -> Allow. Then:
sudo go-mtpfs -allow-other /media/mtp/phone

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-fline "/media/mtp/phone/")
# (find-fline "/media/mtp/phone/Phone/DCIM/Screenshots/")

cd /media/mtp/phone/Phone/DCIM/Screenshots/
rsync -avvz -e *.jpg /tmp/
cd

ls -lt         /media/mtp/phone/

sudo go-mtpfs -allow-other /media/mtp/phone
ls -lt         /media/mtp/phone/



https://wiki.debian.org/mtp




#  Local Variables:
#  coding:               utf-8-unix
#  End: