scripts/mount-phone

16 lines
299 B
Plaintext
Raw Permalink Normal View History

#!/bin/sh
MTP_ENDPOINT=$(gio mount -li | rg activation_root | cut -d "=" -f 2)
if [ $# -gt 0 ] && [ $1 == "-u" ]; then
gio mount -u $MTP_ENDPOINT
exit 1
fi
gio mount $MTP_ENDPOINT >/dev/null 2>&1
MTP_PATH=$(gio info $MTP_ENDPOINT | rg local | cut -d ":" -f 2- | sed 's/ *//')
echo $MTP_PATH