Closed uwidev closed 1 month ago
GUI file managers are technically supported. However it's more of an issue of whether the file manager can support handlr-regex
, not the other way around. More specifically, shadowing xdg-open
only works if the program you want to use handlr
uses xdg-open
to open files.
I am not very familiar with Thunar or PCManFM, but according to the Arch Linux Wiki, Thunar and PCManFM do not use xdg-open
. Instead, they use the GIO library to determine which program should open a given file.
Unfortunately, I am not aware of any workaround for this.
I tried to add nomacs as my default image viewer on handlr.toml as follows, but it isn't recognized when running handlr get image/png.
This is expected. handlr get
does not support regex handlers in handlr.toml
.
Using a TUI file manager like yazi has the file open correctly. I have only tested yazi.
This works because yazi
uses xdg-open
by default to open programs.
That's what I was speculating, darn. Because the only way it wouldn't work is if it straight up did not use xdg-open
, or directly referenced the binary on the system rather than looking up $PATH
, or some other weird shenanigans.
Do you have any recommendations on what does work? Perhaps we could have a small documentation of known GUI file managers that utilize xdg-open
? Or maybe I'm not looking at the right places on the arch wiki.
Do you have any recommendations on what does work?
Unfortunately, I do not. It has been years since I last regularly used a GUI file manager.
I know nnn
, yazi
, xplr
, superfile
, and possibly ranger
use xdg-open
at least as a fallback, but those are all TUI file managers.
Perhaps we could have a small documentation of known GUI file managers that utilize xdg-open?
That's a good idea. I'd be up for documenting that as soon I know of any examples. I'm sure there's got to be some program that fits that description.
Or maybe I'm not looking at the right places on the arch wiki.
I haven't been able to find much information there regarding GUI file managers that use xdg-open.
Unfortunately, I haven't had much luck elsewhere either.
I see. I needed a way to manage pictures, hence my usage of thumbnails in GUI file managers. I wonder if there's a TUI that can display like a grid of images but still as TUI. That's something I guess I'd have to do research on my own.
But that said, as a workaround, earlier I mentioned that using image/gif
works as expected. What are your thoughts on having image/*
insert all known mime types of image/
into mimeapps.list
? I could see it as potentially troublesome to manage, however.
I see. I needed a way to manage pictures, hence my usage of thumbnails in GUI file managers. I wonder if there's a TUI that can display like a grid of images but still as TUI. That's something I guess I'd have to do research on my own.
I know nnn
has something like that with its imgview
plugin.
You probably already know this, but other TUI file managers like yazi
, xplr
, and I think maybe ranger
support image previews, but only for the currently selected file.
But that said, as a workaround, earlier I mentioned that using image/gif works as expected. What are your thoughts on having image/* insert all known mime types of image/ into mimeapps.list? I could see it as potentially troublesome to manage, however.
I might consider adding an option that enables that behaviour, but I can't promise I'll be able to get around to implementing it anytime soon.
You might want to check out mimeo. It works that way and it even has a feature that's similar to handlr-regex
's regex handlers. In fact, it inspired this fork.
Thank you. I will take a look at mimeo, but I'll take a look around at handlr's code when I get the chance to see how feasible it would be to do something like that. I really like handlr's user logic and would like to continue using it.
I'm having some issues getting files to open properly using GUI file managers. They do not open files with the correct program.
Tested GUI file managers:
pcmanfm-qt
thunar
Here's my barebones
mimeapps.list
I have tried touching
handlr.toml
, however I was not able to get anything to work. I gave up messing with it and am just using defaults.I tried to add
nomacs
as my default image viewer onhandlr.toml
as follows, but it isn't recognized when runninghandlr get image/png
. This is when unsetting theimage/*
assignment under mimeapps.list. So I'm not too sure if this is the problem, as I followed a similar formatting to the readme.For reference, this is what the .desktop for nomacs is.
Running
xdg-mime
with debugimage/png
yields the following.Running
handlr get image/png
yields what I expect:org.nomacs.ImageLounge.desktop
.I have xdg-open shadowed as seen in the readme.
Using a TUI file manager like
yazi
has the file open correctly. I have only testedyazi
.No, I do not have any other
*-mimeapps.list
files under~/.config
.I have gotten this to work when I use
image/png
. It will work on my GUI file explorers, and when using built-inxdg-open
. However, this does seem to defeat the purpose of handlr-regex and wildcard support.I don't know what I'm doing wrong or if it just straight up isn't supported for GUI file handlers. Any help in troubleshooting this, etc., would be appreciated.