Cleanup old ranger config

This commit is contained in:
Emmet 2025-10-31 10:51:29 -05:00
parent cd339f647c
commit fe829f69c2
3 changed files with 0 additions and 51 deletions

View file

@ -12,7 +12,6 @@
xdg.enable = false;
# programs
ranger.enable = true;
yazi.enable = true;
git.enable = true;
};

View file

@ -1,35 +0,0 @@
{ lib, pkgs, ... }:
{
config = {
nixpkgs.overlays = [
(self: super:
{
ranger = super.ranger.overrideAttrs (oldAttrs: {
preConfigure = ''
substituteInPlace ranger/__init__.py \
--replace "DEFAULT_PAGER = 'less'" "DEFAULT_PAGER = '${lib.getBin pkgs.bat}/bin/bat'"
# 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"
# adds this patch: https://github.com/ranger/ranger/pull/1758
# fixes a bug for kitty users that use image previews
substituteInPlace ranger/ext/img_display.py \
--replace "self.image_id -= 1" "self.image_id = max(0, self.image_id - 1)"
# fixes the .desktop file
substituteInPlace doc/ranger.desktop \
--replace "Icon=utilities-terminal" "Icon=user-desktop"
substituteInPlace doc/ranger.desktop \
--replace "Terminal=true" "Terminal=false"
substituteInPlace doc/ranger.desktop \
--replace "Exec=ranger" "Exec=kitty -e ranger %U"
'';
});
}
)
];
};
}

View file

@ -532,21 +532,6 @@ in
#!/bin/sh
hyprctl monitors -j | jq ".[$1] | .activeWorkspace.id"
'')
(pkgs.writeScriptBin "open-under-ranger" ''
#!/bin/sh
command="$1"
echo $command
file="''${*:2}"
file=''${file// /\\ }
echo $file
workspace=$(hyprctl monitors -j | jq ".[] | select(.specialWorkspace.name == \"special:scratch_yazi\") | .activeWorkspace.id")
if [ -z "''${workspace}" ]; then
hyprctl dispatch exec -- "$command";
else
hyprctl dispatch exec "[workspace $workspace]" -- "$command" "$file";
fi
hyprctl dispatch togglespecialworkspace scratch_yazi
'')
(pkgs.writeScriptBin "sct" ''
#!/bin/sh
killall wlsunset &> /dev/null;