Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show mount points #1272

Open
1 task
Ape opened this issue Jul 8, 2024 · 7 comments
Open
1 task

Show mount points #1272

Ape opened this issue Jul 8, 2024 · 7 comments
Labels
feature New feature request

Comments

@Ape
Copy link
Contributor

Ape commented Jul 8, 2024

Please describe the problem you're trying to solve

I'd like to see if a directory is a mount point.

Would you be willing to contribute this feature?

  • Yes, I'll give it a shot

Describe the solution you'd like

It could look something like this:

bin
boot (vfat on /dev/sdb1)
dev (devtmpfs)
etc
home (btrfs on /dev/sdc1)
lib
lib64
mnt
opt
proc (proc)
root
run (tmpfs)
sbin
srv
sys (sysfs)
tmp (tmpfs)
usr
var

Additional context

No response

@Ape Ape added the feature New feature request label Jul 8, 2024
@sxyazi
Copy link
Owner

sxyazi commented Jul 8, 2024

Does this mean it only works on Unix systems? I'm not sure if Windows has the concept of mount points.

I think it should be implemented as a plugin rather than a builtin feature. Recently, I've been enhancing the API for extending UI components with plugins, #1257. This will make it easier to implement it as a UI plugin & fetcher.

@Ape
Copy link
Contributor Author

Ape commented Jul 8, 2024

Yeah, I guess this would be Unix only. I'd be happy to have the feature as a plugin.

@Ape
Copy link
Contributor Author

Ape commented Jul 11, 2024

I made a proof-of-concept plugin for this feature: https://github.com/Ape/mount-points.yazi

However, it is currently quite unusable because of performance implications. The plugin refreshes the mount point information constantly. Ideally it would do it in a task and only when needed.

@AnirudhG07
Copy link
Contributor

@Ape there's a plugin archivemount.yazi, it can mount archives(as the name suggests) as well tell if a direc is a mountpoint or not.
Check if out. If you do not find it satisfactory, we can update the UI part for that plugin, as per requirements suggest. Thanks!

@Ape
Copy link
Contributor Author

Ape commented Jul 19, 2024

@Ape there's a plugin archivemount.yazi, it can mount archives(as the name suggests) as well tell if a direc is a mountpoint or not. Check if out. If you do not find it satisfactory, we can update the UI part for that plugin, as per requirements suggest. Thanks!

That plugin doesn't seem to currently have the feature I'm looking for. Check mount-points.yazi for reference.

@ovwxxwvo
Copy link

ovwxxwvo commented Nov 18, 2024

@Ape @sxyazi hey, mate ! how about this. I thing this will be a little bit better.
20241118_122704
rewrite the Status:name fn, deal the name with linked|mounted.

function Status:name()
	local h = self._tab.current.hovered
	if not h then return ui.Line {} end

   	local mounted = io.popen("findmnt -n --output SOURCE,FSTYPE ".."'"..tostring(h.url).."'"):read("*a")
 	if mounted ~= "" then
 	 	mounted = " <- " .. mounted
 	 	return ui.Line(" " .. h.name .. mounted)
 	 	end

 	local linked = h.link_to
 	if linked ~= nil then
 		linked = " -> " .. tostring(linked)
 	   	return ui.Line(" " .. h.name .. linked)
 	   	end

  end

@SL-RU
Copy link

SL-RU commented Nov 29, 2024

I am author of https://github.com/SL-RU/ranger_udisk_menu and recently switched to yazi. I in progress of implementing same functionality in yazi

sxyazi 4rtemis-4rrow FYI related to #927

@sxyazi sxyazi mentioned this issue Jan 17, 2025
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request
Projects
None yet
Development

No branches or pull requests

5 participants