move lf configuration and use upstream

This commit is contained in:
Tristan 2024-01-05 22:02:50 +00:00
parent 67cb4995f9
commit f3685dcbf5
5 changed files with 156 additions and 165 deletions

View file

@ -0,0 +1,49 @@
{pkgs, ...}: let
readScript = path: '' ''${{
${builtins.readFile path}
}}'';
in {
home.packages = with pkgs; [
# previewer
chafa
exiftool
bat
ffmpegthumbnailer
trash-cli
imagemagick
gnumeric
poppler_utils
odt2txt
python311Packages.docx2txt
catdoc
libcdio
p7zip
file
gnome-epub-thumbnailer
];
programs.lf.enable = true;
programs.lf.keybindings = {
D = "trash";
R = "drag";
"<f-2>" = ":rename";
"<enter>" = "open-with";
};
programs.lf.extraConfig = ''
set sixel true
'';
programs.lf.commands = {
drag = "%${pkgs.ripdrag}/bin/ripdrag -x \"$fx\"";
trash = "%trash-put \"$fx\"";
open = "$set -f; ${pkgs.ranger}/bin/rifle -p 0 \"$fx\"";
open-with = '' ''${{
set -f
${pkgs.ranger}/bin/rifle -l "$fx"
read -p "Open with: " method
${pkgs.ranger}/bin/rifle -p "$method" "$fx"
}}'';
bulk-rename = readScript ./bulk-rename.sh;
};
programs.lf.previewer.source = ./preview.sh;
}