chmln / handlr

A better xdg-utils
MIT License
616 stars 24 forks source link

implement mimeo-style regex handlers #60

Closed Anomalocaridid closed 2 months ago

Anomalocaridid commented 2 years ago

Addresses #57 and sort of indirectly addresses #56.

I added the ability to associate arbitrary commands with files and URLs that match regular expressions, similar to what another resource opener, mimeo, supports. See my changes to README.md for detailed info on how it would be used.

They would be defined in ~/.config/handlr/config.toml, which I figured would be fine since it was previously only used for two options.

However, I have only implemented this functionality as it pertains to handlr open. So they will currently not be included in handlr list or handlr get or assignable with handlr set.

Also, I should mention that I used sort of a hack that essentially creates a faux instance of DesktopEntry so that I could leverage the existing command execution code without making major changes to it.

At one point, I had to update handlr's dependencies to fix an issue with the regex crate, so I had to fix a few lines of unrelated code due to a breaking change in clap.

Edit: I think updating Clap makes this pull request address #53 as well.

Anomalocaridid commented 2 years ago

After no response for about a month and no activity on this repo since August 2021, I have decided to spin off my fork as its own project.

Github repo: https://github.com/Anomalocaridid/handlr-regex AUR packages: handlr-regex, handlr-regex-bin

However, just in case this repository becomes actively maintained again, I will keep this pull request open and maintain the associated branch. I would still be happy to have my changes added to handlr if the maintainer would be open to that.

Needless to say, any questions or concerns should be directed towards my fork's Github repo or AUR listing rather than made here unless it pertains to this pull request and whether it will be merged or not.

Anomalocaridid commented 2 months ago

More than two years after I made this PR, I have long since accepted this repo is dead.

To the owner of this repo: thanks for everything and I wish you nothing but the best.