From 4f14ccee0779d367390f447e70e99862b441c854 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Thu, 27 Sep 2018 18:18:06 +0100 Subject: ranger: fix out-of-the-box previews I'm guessing this became commented out by default at some point. --- pkgs/applications/misc/ranger/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkgs/applications') diff --git a/pkgs/applications/misc/ranger/default.nix b/pkgs/applications/misc/ranger/default.nix index 6d883d89de31..26387264b643 100644 --- a/pkgs/applications/misc/ranger/default.nix +++ b/pkgs/applications/misc/ranger/default.nix @@ -36,7 +36,7 @@ python3Packages.buildPythonApplication rec { # give file previews out of the box substituteInPlace ranger/config/rc.conf \ - --replace "set preview_script ~/.config/ranger/scope.sh" "set preview_script $out/share/doc/ranger/config/scope.sh" + --replace "#set preview_script ~/.config/ranger/scope.sh" "set preview_script $out/share/doc/ranger/config/scope.sh" '' + optionalString imagePreviewSupport '' substituteInPlace ranger/ext/img_display.py \ --replace /usr/lib/w3m ${w3m}/libexec/w3m -- cgit 1.4.1 From d152089772b31417cd243c73fb5d5878d7512f7a Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Thu, 27 Sep 2018 18:18:30 +0100 Subject: ranger: syntax highlight previews by default --- pkgs/applications/misc/ranger/default.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'pkgs/applications') diff --git a/pkgs/applications/misc/ranger/default.nix b/pkgs/applications/misc/ranger/default.nix index 26387264b643..5417a135dda4 100644 --- a/pkgs/applications/misc/ranger/default.nix +++ b/pkgs/applications/misc/ranger/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, python3Packages, file, less +{ stdenv, lib, fetchFromGitHub, python3Packages, file, less, highlight , imagePreviewSupport ? true, w3m ? null}: with stdenv.lib; @@ -24,6 +24,11 @@ python3Packages.buildPythonApplication rec { ''; preConfigure = '' + ${lib.optionalString (highlight != null) '' + sed -i -e 's|^\s*highlight\b|${highlight}/bin/highlight|' \ + ranger/data/scope.sh + ''} + substituteInPlace ranger/data/scope.sh \ --replace "/bin/echo" "echo" @@ -46,7 +51,7 @@ python3Packages.buildPythonApplication rec { --replace "set preview_images false" "set preview_images true" ''; - meta = with stdenv.lib; { + meta = with lib; { description = "File manager with minimalistic curses interface"; homepage = http://ranger.github.io/; license = licenses.gpl3; -- cgit 1.4.1