Detecting a phone when connected by USB(ubuntu 16.04) How can I detect a device independent USB insert eventMounting USB disks automatically (How it works)Adding files to a cell phone connected via USBSystem claims my USB is mounted when I insert it and I cannot (un)mount it. How do I fix this?Suspending fails when a USB mouse is connectedUSB only detected when connected to internetLinux Mint - Not detecting monitor connected via USB-C to HDMI hubExternal displays not detected when connected through USB-C hubUSB MIDI device crashes when connected to second deviceCan i use smartphone tethering instead of USB wireless inthernet lan card in Linux?Fedora 28 USB phone mount troubles
aging parents with no investments
Manga about a female worker who got dragged into another world together with this high school girl and she was just told she's not needed anymore
How to answer pointed "are you quitting" questioning when I don't want them to suspect
Copycat chess is back
I see my dog run
Crop image to path created in TikZ?
What is the command to reset a PC without deleting any files
Why do we use polarized capacitors?
Why airport relocation isn't done gradually?
Can the Produce Flame cantrip be used to grapple, or as an unarmed strike, in the right circumstances?
Why was the "bread communication" in the arena of Catching Fire left out in the movie?
Are objects structures and/or vice versa?
Finding files for which a command fails
Denied boarding due to overcrowding, Sparpreis ticket. What are my rights?
Prime joint compound before latex paint?
How did the USSR manage to innovate in an environment characterized by government censorship and high bureaucracy?
Add an angle to a sphere
Shall I use personal or official e-mail account when registering to external websites for work purpose?
Is Social Media Science Fiction?
Why did the Germans forbid the possession of pet pigeons in Rostov-on-Don in 1941?
Why doesn't a const reference extend the life of a temporary object passed via a function?
How to make particles emit from certain parts of a 3D object?
Is it legal to have the "// (c) 2019 John Smith" header in all files when there are hundreds of contributors?
Is it wise to focus on putting odd beats on left when playing double bass drums?
Detecting a phone when connected by USB
(ubuntu 16.04) How can I detect a device independent USB insert eventMounting USB disks automatically (How it works)Adding files to a cell phone connected via USBSystem claims my USB is mounted when I insert it and I cannot (un)mount it. How do I fix this?Suspending fails when a USB mouse is connectedUSB only detected when connected to internetLinux Mint - Not detecting monitor connected via USB-C to HDMI hubExternal displays not detected when connected through USB-C hubUSB MIDI device crashes when connected to second deviceCan i use smartphone tethering instead of USB wireless inthernet lan card in Linux?Fedora 28 USB phone mount troubles
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I'm writing a bash script to synchronize pictures in my phone with my PC. What I need is to
- detect if the phone is connected to a USB port
- which port is used, and then
- access it.
I'm not connecting my phone via USB tethering.
The code that I already have it's this:
tmp=`gio mount -l -i | grep activation_root`
mount_point=$tmp//activation_root=/
gio mount $mount_point
cp /run/user/1000/gvfs/*/*/DCIM/Camera/*.jpg ~/Test`
With this I'm getting the device and mounting it, but I'm hardcoded the path used in the cp command. I need a way to obtain that path through a command or a way to use the command gio copy
for this situation.
linux bash usb smartphone
New contributor
add a comment |
I'm writing a bash script to synchronize pictures in my phone with my PC. What I need is to
- detect if the phone is connected to a USB port
- which port is used, and then
- access it.
I'm not connecting my phone via USB tethering.
The code that I already have it's this:
tmp=`gio mount -l -i | grep activation_root`
mount_point=$tmp//activation_root=/
gio mount $mount_point
cp /run/user/1000/gvfs/*/*/DCIM/Camera/*.jpg ~/Test`
With this I'm getting the device and mounting it, but I'm hardcoded the path used in the cp command. I need a way to obtain that path through a command or a way to use the command gio copy
for this situation.
linux bash usb smartphone
New contributor
You may find unix.stackexchange.com/questions/315216/… useful
– K7AAY
Apr 5 at 17:06
1
Show us what you have, then show us which part you're currently having trouble with. Don't ask us to write the entire script for you.
– Shadur
2 days ago
add a comment |
I'm writing a bash script to synchronize pictures in my phone with my PC. What I need is to
- detect if the phone is connected to a USB port
- which port is used, and then
- access it.
I'm not connecting my phone via USB tethering.
The code that I already have it's this:
tmp=`gio mount -l -i | grep activation_root`
mount_point=$tmp//activation_root=/
gio mount $mount_point
cp /run/user/1000/gvfs/*/*/DCIM/Camera/*.jpg ~/Test`
With this I'm getting the device and mounting it, but I'm hardcoded the path used in the cp command. I need a way to obtain that path through a command or a way to use the command gio copy
for this situation.
linux bash usb smartphone
New contributor
I'm writing a bash script to synchronize pictures in my phone with my PC. What I need is to
- detect if the phone is connected to a USB port
- which port is used, and then
- access it.
I'm not connecting my phone via USB tethering.
The code that I already have it's this:
tmp=`gio mount -l -i | grep activation_root`
mount_point=$tmp//activation_root=/
gio mount $mount_point
cp /run/user/1000/gvfs/*/*/DCIM/Camera/*.jpg ~/Test`
With this I'm getting the device and mounting it, but I'm hardcoded the path used in the cp command. I need a way to obtain that path through a command or a way to use the command gio copy
for this situation.
linux bash usb smartphone
linux bash usb smartphone
New contributor
New contributor
edited 14 hours ago
Gerardo Martínez Rodríguez
New contributor
asked Apr 5 at 16:18
Gerardo Martínez RodríguezGerardo Martínez Rodríguez
112
112
New contributor
New contributor
You may find unix.stackexchange.com/questions/315216/… useful
– K7AAY
Apr 5 at 17:06
1
Show us what you have, then show us which part you're currently having trouble with. Don't ask us to write the entire script for you.
– Shadur
2 days ago
add a comment |
You may find unix.stackexchange.com/questions/315216/… useful
– K7AAY
Apr 5 at 17:06
1
Show us what you have, then show us which part you're currently having trouble with. Don't ask us to write the entire script for you.
– Shadur
2 days ago
You may find unix.stackexchange.com/questions/315216/… useful
– K7AAY
Apr 5 at 17:06
You may find unix.stackexchange.com/questions/315216/… useful
– K7AAY
Apr 5 at 17:06
1
1
Show us what you have, then show us which part you're currently having trouble with. Don't ask us to write the entire script for you.
– Shadur
2 days ago
Show us what you have, then show us which part you're currently having trouble with. Don't ask us to write the entire script for you.
– Shadur
2 days ago
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Gerardo Martínez Rodríguez is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f510752%2fdetecting-a-phone-when-connected-by-usb%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Gerardo Martínez Rodríguez is a new contributor. Be nice, and check out our Code of Conduct.
Gerardo Martínez Rodríguez is a new contributor. Be nice, and check out our Code of Conduct.
Gerardo Martínez Rodríguez is a new contributor. Be nice, and check out our Code of Conduct.
Gerardo Martínez Rodríguez is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f510752%2fdetecting-a-phone-when-connected-by-usb%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You may find unix.stackexchange.com/questions/315216/… useful
– K7AAY
Apr 5 at 17:06
1
Show us what you have, then show us which part you're currently having trouble with. Don't ask us to write the entire script for you.
– Shadur
2 days ago