-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
ranger: add video and pdf preview options #70432
Conversation
I would love to see it installable out of the box. Have you checked the impact on closure size though ? It might be best to provide a module or a wrapper in charge of generating the scope.sh. Would prevent useless rebuilds/caching. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One necessary change, the other more a request pending addition to scope.sh
, all that'd have to change is to allow either poppler or mupdf as dependency.
@@ -1,9 +1,13 @@ | |||
{ stdenv, lib, fetchFromGitHub, python3Packages, file, less, highlight | |||
, imagePreviewSupport ? true, w3m ? null}: | |||
, imagePreviewSupport ? true, w3m ? null | |||
, pdfPreviewSupport ? true, poppler_utils ? null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be great if you could add support for mutool
too, we already do this for text previews. I'll open an issue on this over at ranger/ranger.
@@ -52,6 +58,12 @@ python3Packages.buildPythonApplication rec { | |||
# give image previews out of the box when building with w3m | |||
substituteInPlace ranger/config/rc.conf \ | |||
--replace "set preview_images false" "set preview_images true" | |||
'' + optionalString pdfPreviewSupport '' | |||
# edits scope.sh and enables video previews via ffmpegthumbnailer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You swapped the comments around it seems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Diff seems fine overall. If the closure size impact is too high, we could also add two packages (e.g. ranger
and ranger-full
).
Apart from that I agree with @teto, the optional features should be moved to a wrapper for less rebuilds :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes more sense to go for a module straightaway. Maybe even in home-manager if that's what you use ?
A pure nix way to config ranger would be awesome, but how would a module for it look like? Something like this?
|
You don't have to cover all the configurations items from the start. Just enable and maybe |
I'll take a look at this and other reviews an try to write a wrapper as to improve my nix-fu. |
Tbh I'm not sure if that's a good idea: |
the changes modify the configuration, we shouldn't have to reinstall the package just to modify the config. @mtrsk you can look at neovim for a wrapper example. |
Thanks, I'll take a look at the neovim wrapper (for learning purposes).
It seems it's best to close this PR, as adding more options seems to bring more harm than benefits (once we take into account user friendliness). Making a home-manager module for ranger makes more sense. |
You can ping me on irc or at home-manager should you have any question, I would really like such a module ;) |
Has any progress of the home-manager configuration been made? |
@JohnAZoidberg I've never had the time to tackle this |
Motivation for this change
An attempt to add video & pdf previews to ranger via the nix derivation out of the box
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @