You are not logged in.

#1 2025-09-20 16:45:19

TySpicer
Member
Registered: 2025-08-31
Posts: 101

[SOLVED] nnn - Connect to Android phone

I made a post about this on the Linux Mint forums: https://forums.linuxmint.com/viewtopic.php?t=451891

I was able to figure it out pretty easily from there. Basically, when I plug in my phone, it's located at /run/user/1000/gvfs. I tried this in Arch, and the folder wasn't there. I found this article: https://wiki.archlinux.org/title/Media_ … r_Protocol

Section 5 is about file manager integration. I installed gvfs-mtp, and it created the folder /run/user/1000/gvfs. However, my phone still doesn't show up there. Is there something else I need to install?

The article also mentioned I could get to it with a URL, for example `mtp://[usb:002,013]/`. How would I do this with nnn? Maybe I don't need this, I'd rather just bookmark a folder.

Last edited by TySpicer (2025-10-02 21:49:32)

Offline

#2 2025-09-20 17:16:29

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,999
Website

Re: [SOLVED] nnn - Connect to Android phone

Do you have a file manager installed that can use the GVFS backend? For example thunar can be set to automount devices on plugin. It needs to be running as a background daemon though.


Jin, Jîyan, Azadî

Offline

#3 2025-09-20 18:02:22

TySpicer
Member
Registered: 2025-08-31
Posts: 101

Re: [SOLVED] nnn - Connect to Android phone

I just have nnn at the moment, I was hoping I wouldn't have to install a GUI file manager at all. Sounds like the issue is automounting, then. Is there a simple automounting daemon you would recommend, or should I try thunar?

Offline

#4 2025-09-20 18:25:54

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,999
Website

Re: [SOLVED] nnn - Connect to Android phone

I don't use that sort of thing so I would have to refer you to https://wiki.archlinux.org/title/File_m … Standalone, which links to https://wiki.archlinux.org/title/List_o … ount_tools. Does that help?

EDIT: did some digging and found https://github.com/jarun/nnn/wiki/Basic … ged-drives, which leads to https://wiki.archlinux.org/title/Udisks#Mount_helpers. I don't want to spoil your fun so I'll leave the rest to you big_smile

Last edited by Head_on_a_Stick (2025-09-20 18:38:25)


Jin, Jîyan, Azadî

Offline

#5 2025-09-20 18:42:26

TySpicer
Member
Registered: 2025-08-31
Posts: 101

Re: [SOLVED] nnn - Connect to Android phone

Yeah, this looks like what I'm looking for! I went ahead and installed ldm, although I'm not sure how to use it. Under the installation section on the GitHub, it said it needs a config file. I created the file and filled it with:

MOUNT_OWNER=tyspicer
BASE_MOUNTPOINT=/mnt

Then, I ran:

systemctl enable ldm.service

From here, does this auto-mount devices like my phone and flash drive? I'm still not seeing the phone in /run/user/1000/gvfs. Would it be located somewhere else? Is there something else I need to do to set this up?

Offline

#6 2025-09-20 19:47:26

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,999
Website

Re: [SOLVED] nnn - Connect to Android phone

The mountpoint appears to be defined in your configuration file. Have you looked there?


Jin, Jîyan, Azadî

Offline

#7 2025-09-20 19:59:38

TySpicer
Member
Registered: 2025-08-31
Posts: 101

Re: [SOLVED] nnn - Connect to Android phone

Good point! I checked in /mnt, and it wasn't there. I also tried changing to config file to "/run/user/1000/gvfs" instead of "/mnt", and I still couldn't find it.

Offline

#8 2025-09-20 22:32:45

TySpicer
Member
Registered: 2025-08-31
Posts: 101

Re: [SOLVED] nnn - Connect to Android phone

Update - After rebooting, I checked /mnt, and it has my flash drive. Still no phone, though. Maybe because my flash drive was plugged in when I booted into Arch, but my phone wasn't?

Last edited by TySpicer (2025-09-20 22:36:40)

Offline

#9 2025-09-21 10:18:08

Head_on_a_Stick
Member
From: The Wirral
Registered: 2014-02-20
Posts: 8,999
Website

Re: [SOLVED] nnn - Connect to Android phone

I'm not very good with C but it looks like ldm doesn't support mtp. Have you checked the links I supplied in my EDIT for post #4? Please understand that I don't know how to do what you want to do so I've just searched for clues as to how to do that and I am expecting you to investigate further and attempt to understand the process yourself so you can figure it out and report back here for the benefit of other Arch users.


Jin, Jîyan, Azadî

Offline

#10 2025-09-21 14:07:00

TySpicer
Member
Registered: 2025-08-31
Posts: 101

Re: [SOLVED] nnn - Connect to Android phone

Head_on_a_Stick wrote:

it looks like ldm doesn't support mtp.

I went back to the link you posted, and I found udiskie. I tried it before, but couldn't get it to work. I'll try it again.

I installed udiskie and put `exec-once = udiskie` in my hyprland.conf. I also put the following into ~/.config/udiskie/config.json:

program_options:
	automount: true
	notify: true

I also uninstalled ldm so there's no overlap, then rebooted.

It looks like udiskie is supposed to auto-mount to /run/media/tyspicer/. I went to this directory, and there's nothing there (I have my flash drive and phone plugged in). I tried running `udiskie-info -a` to list available devices, and I got this:

Traceback (most recent call last):
  File "/usr/bin/udiskie-info", line 33, in <module>
    sys.exit(load_entry_point('udiskie==2.5.8', 'console_scripts', 'udiskie-info')())
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3.13/site-packages/udiskie/cli.py", line 188, in main
    return cls(argv).run()
           ~~~^^^^^^
  File "/usr/lib/python3.13/site-packages/udiskie/cli.py", line 167, in __init__
    config = udiskie.config.Config.from_file(config_file)
  File "/usr/lib/python3.13/site-packages/udiskie/config.py", line 229, in from_file
    return cls.from_file(path)
           ~~~~~~~~~~~~~^^^^^^
  File "/usr/lib/python3.13/site-packages/udiskie/config.py", line 245, in from_file
    return cls(load(f))
               ~~~~^^^
  File "/usr/lib/python3.13/json/__init__.py", line 293, in load
    return loads(fp.read(),
        cls=cls, object_hook=object_hook,
        parse_float=parse_float, parse_int=parse_int,
        parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "/usr/lib/python3.13/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
           ~~~~~~~~~~~~~~~~~~~~~~~^^^
  File "/usr/lib/python3.13/json/decoder.py", line 345, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/json/decoder.py", line 363, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

So maybe something is wrong with udiskie?

Offline

#11 2025-09-26 01:29:51

TySpicer
Member
Registered: 2025-08-31
Posts: 101

Re: [SOLVED] nnn - Connect to Android phone

(Does replying to a post bump it, so people can see it?)

I still haven't figured this out. I can mount and unmount my flash drive with keybinds (in hyprland.conf):

bind = CTRL SHIFT, M, exec, udisksctl mount -b /dev/sdb && notify-send "Flash drive mounted" || notify-send "Error: Flash drive already mounted"
bind = CTRL SHIFT, U, exec, udisksctl unmount -b /dev/sdb && notify-send "Flash drive unmounted" || notify-send "Error: Flash drive not mounted"

It would be cool if udiskie would auto-mount the flash drive, then I could still use the keybind to unmount it, but this is not a huge deal for now.

On the other hand, I still don't know how to connect to my phone. Hopefully I can figure out how to auto-mount it with udiskie. Even if not, how can I manually mount my phone?

Offline

#12 2025-10-02 13:49:09

TySpicer
Member
Registered: 2025-08-31
Posts: 101

Re: [SOLVED] nnn - Connect to Android phone

Update - I recently discovered I actually do have Nautilus installed (it probably came with Hyprland). I can see the phone there, so it does auto-mount! I checked `/run/user/1000/gvfs`, and the phone is there.

Head_on_a_Stick mentioned running Nautilus as a daemon so the phone auto-mounts and I can just use nnn. How would I run Nautilus as a daemon?

Offline

#13 2025-10-02 20:36:46

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,520

Re: [SOLVED] nnn - Connect to Android phone

Could you try pcmanfm(-gtk3) with gvfs-mtp
If you must you can run pcmanfm as a daemon

Just enable file-transfer on the phone, open pcmanfm and close it again
The 'mtp:host' mount in '/run/.../gvfs/your-phone' should be enabled
Use your favorite file manager(ranger, but nnn should work too) and scripts to backup FI.

'gio mount' should be working but it doesn't:( at least for me
After your done kill the file transfer on the phone

these steps work for me in wayland (labwc) and X too btw.

Offline

#14 2025-10-02 21:49:13

TySpicer
Member
Registered: 2025-08-31
Posts: 101

Re: [SOLVED] nnn - Connect to Android phone

pcmanfm-gtk3 works! I put

exec-once = pcmanfm -d

in my `hyprland.conf` so it automatically starts as a daemon. There was an annoying pop-up that asked what I would like to do when the phone is plugged in. I went to Edit, Preferences, Volume Management, and unchecked "Show available options for removable media when they are inserted." Now, I can simply plug in my phone, and get to it from nnn automatically, no questions asked. Perfect!

This works for my flash drive as well, which is great! I used a keyboard shortcut to mount it before, but now it auto-mounts. I still use a keyboard shortcut to unmount it, but that's probably easier than anything else I could do, anyway.

Thanks for the help!

Offline

#15 2025-10-04 11:00:41

tekstryder
Member
Registered: 2013-02-14
Posts: 440

Re: [SOLVED] nnn - Connect to Android phone

TySpicer wrote:

I actually do have Nautilus installed (it probably came with Hyprland)

Ftr... no, it didn't.

Offline

#16 2025-10-04 13:58:33

TySpicer
Member
Registered: 2025-08-31
Posts: 101

Re: [SOLVED] nnn - Connect to Android phone

tekstryder wrote:

no, it didn't.

Well, I don't remember installing it. I'm pretty sure I had it early on, because anything that opens a file with Ctrl+O opens a GUI file manager. I assumed it was a generic file manager, but now that I've seen Nautilus, it looks like it's Nautilus.

Maybe it has to do with gtk3?

Offline

#17 2025-10-04 14:39:55

tekstryder
Member
Registered: 2013-02-14
Posts: 440

Re: [SOLVED] nnn - Connect to Android phone

TySpicer wrote:

Maybe it has to do with gtk3?

Nope again tongue ...nautilus is GTK4

You likely installed it. See "Required By" on the package page for other possibilities that could've pulled it in.

And of course you can simply peruse your pacman log to find the install date and see what buddies came along with.

If you wanna get fancy with it...

$ grep -iE --color=always 'installed|reinstalled|upgraded|removed' /var/log/pacman.log | sed 's/^.//g;s/T/ /g;s/+0200\]\s\[ALPM\]//g'| less - | grep -B 10 -A 10 "nautilus"

Last edited by tekstryder (2025-10-04 14:40:12)

Offline

#18 2025-10-04 14:44:41

TySpicer
Member
Registered: 2025-08-31
Posts: 101

Re: [SOLVED] nnn - Connect to Android phone

Ah, I see, it's probably xdg-desktop-portal-gnome. I don't even remember what that does, but I think I installed it from instructions on the Hyprland wiki.

Offline

#19 Yesterday 10:55:03

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,520

Re: [SOLVED] nnn - Connect to Android phone

...but I think I installed it from instructions on the Hyprland wiki.

This is not an advice on the Hyprland wiki page,also wink

@textstryder

grep +sed=awk
The way you lookup 'nautilus' in this case is not giving what you would expect
Marked 'installed upgraded etc' while only the search should be highlighted
You remove 'T', but it would remove all capital T's
Removing only works for '+0200' not '+0530'

This line respect the above, and grep still gives a formatted colored output, only the searched program!

awk '/installed|reinstalled|upgraded|removed/{gsub(/\[|\]|[+-][0-9][0-9][0-9]0|ALPM/, ""); sub(/T/, " "); print}' /var/log/pacman.log | grep -B 2 -A 2 "vim"

edit: changed '+' into '[+-]'

Last edited by qinohe (Yesterday 11:41:28)

Offline

#20 Yesterday 11:17:37

tekstryder
Member
Registered: 2013-02-14
Posts: 440

Re: [SOLVED] nnn - Connect to Android phone

tekstryder wrote:

If you wanna get fancy with it...

qinohe wrote:

grep +sed=awk

Yeah, yeah. Hey, I didn't claim it couldn't get fancier haha.

Mine:

2025-08-11 08:45:30-0400] [ALPM] upgraded gtk3 (1:3.24.49-2 -> 1:3.24.50-1)
2025-08-11 08:45:30-0400] [ALPM] upgraded tdb (1.4.13-1 -> 1.4.14-1)
2025-08-11 08:45:30-0400] [ALPM] upgraded vim-runtime (9.1.1552-1 -> 9.1.1623-1)
2025-08-11 08:45:30-0400] [ALPM] upgraded vim (9.1.1552-1 -> 9.1.1623-1)
2025-08-11 16:08:51-0400] [ALPM] upgraded python-fasteners (0.19-4 -> 0.20-1)
2025-08-12 09:24:06-0400] [ALPM] upgraded nvidia-utils (580.65.06-1.1 -> 580.76.05-1.1)
--
2025-09-05 08:49:48-0400] [ALPM] upgraded linux-lts-headers (6.12.44-1 -> 6.12.45-1)
2025-09-05 08:49:48-0400] [ALPM] upgraded python-markdown (3.8.2-1 -> 3.9.0-1)
2025-09-05 14:32:26-0400] [ALPM] upgraded vim-runtime (9.1.1623-1 -> 9.1.1734-1)
2025-09-05 14:32:26-0400] [ALPM] upgraded vim (9.1.1623-1 -> 9.1.1734-1)
2025-09-06 09:31:42-0400] [ALPM] upgraded aom (3.13.0-1 -> 3.13.1-1)
2025-09-06 09:31:42-0400] [ALPM] upgraded fastfetch (2.51.1-1 -> 2.52.0-1)

Yours:

2025-08-11 08:45:30-0400  upgraded gtk3 (1:3.24.49-2 -> 1:3.24.50-1)
2025-08-11 08:45:30-0400  upgraded tdb (1.4.13-1 -> 1.4.14-1)
2025-08-11 08:45:30-0400  upgraded vim-runtime (9.1.1552-1 -> 9.1.1623-1)
2025-08-11 08:45:30-0400  upgraded vim (9.1.1552-1 -> 9.1.1623-1)
2025-08-11 16:08:51-0400  upgraded python-fasteners (0.19-4 -> 0.20-1)
2025-08-12 09:24:06-0400  upgraded nvidia-utils (580.65.06-1.1 -> 580.76.05-1.1)
--
2025-09-05 08:49:48-0400  upgraded linux-lts-headers (6.12.44-1 -> 6.12.45-1)
2025-09-05 08:49:48-0400  upgraded python-markdown (3.8.2-1 -> 3.9.0-1)
2025-09-05 14:32:26-0400  upgraded vim-runtime (9.1.1623-1 -> 9.1.1734-1)
2025-09-05 14:32:26-0400  upgraded vim (9.1.1623-1 -> 9.1.1734-1)
2025-09-06 09:31:42-0400  upgraded aom (3.13.0-1 -> 3.13.1-1)
2025-09-06 09:31:42-0400  upgraded fastfetch (2.51.1-1 -> 2.52.0-1)

I never noticed I'd left that trailing right bracket in the timestamp.

I like having the actions (installed, upgraded, etc.) highlighted with color.
EDIT: I don't think BBCode can do color in a code block.

I'll steal some of your idea though... thx!

Last edited by tekstryder (Yesterday 11:21:44)

Offline

#21 Yesterday 11:40:19

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,520

Re: [SOLVED] nnn - Connect to Android phone

tekstryder wrote:

I like having the actions (installed, upgraded, etc.) highlighted with color.
EDIT: I don't think BBCode can do color in a code block.

Ok, we all have preferences lol
Btw. you can color output with BBCode, but I think we all get the picture...

I'll steal some of your idea though... thx!

Off course that's what it's for, welcome

Btw. I didn't realize people living on the '-' of 'earth-time' /0\
Change '+' into '[+-]' , ill change the line too wink

Offline

#22 Yesterday 11:49:27

tekstryder
Member
Registered: 2013-02-14
Posts: 440

Re: [SOLVED] nnn - Connect to Android phone

qinohe wrote:

Btw. you can color output with BBCode

Sure, but...

tekstryder wrote:

I don't think BBCode can do color in a code block.

Cheers!

Offline

#23 Yesterday 12:09:48

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,520

Re: [SOLVED] nnn - Connect to Android phone

tekstryder wrote:

Sure, but...
...
I don't think BBCode can do color in a code block.

Cheers!

Misread, and indeed we can't format code with FluxBB
We need to wait until the next forum has 'arrived'...

Offline

Board footer

Powered by FluxBB