Updates and patches to ranger + kitty setup

This commit is contained in:
Emmet 2023-08-08 21:24:21 -05:00
parent 515672d763
commit 0222b95eca
3 changed files with 27 additions and 1 deletions

View file

@ -10,9 +10,12 @@ let myCbxScript = ''
''; '';
in in
{ {
imports = [ ../../pkgs/ranger.nix ];
home.packages = with pkgs; [ home.packages = with pkgs; [
ranger ranger
xdragon xdragon
highlight
(pkgs.writeScriptBin "cbx" myCbxScript) (pkgs.writeScriptBin "cbx" myCbxScript)
]; ];
home.file.".config/ranger/rc.conf".source = ./rc.conf; home.file.".config/ranger/rc.conf".source = ./rc.conf;

View file

@ -130,7 +130,7 @@ ext cbz, has zathura, X, flag f = zathura -- "$@"
#------------------------------------------- #-------------------------------------------
# Images # Images
#------------------------------------------- #-------------------------------------------
mime ^image, has nsxiv, X, flag f = nsxiv "$@" mime ^image, has krita, X, flag f = krita "$@"
mime ^image/svg, has inkscape, X, flag f = inkscape "$@" mime ^image/svg, has inkscape, X, flag f = inkscape "$@"
#------------------------------------------- #-------------------------------------------

23
user/pkgs/ranger.nix Normal file
View file

@ -0,0 +1,23 @@
{ lib, pkgs, ... }:
{
nixpkgs.overlays = [
(self: super:
{
ranger = super.ranger.overrideAttrs (oldAttrs: rec {
preConfigure = ''
substituteInPlace ranger/__init__.py \
--replace "DEFAULT_PAGER = 'less'" "DEFAULT_PAGER = '${lib.getBin pkgs.less}/bin/less'"
# 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"
substituteInPlace ranger/ext/img_display.py \
--replace "self.image_id -= 1" "self.image_id = max(0, self.image_id - 1)"
'';
});
}
)
];
}