diff options
Diffstat (limited to 'home/lf.nix')
| -rw-r--r-- | home/lf.nix | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/home/lf.nix b/home/lf.nix new file mode 100644 index 0000000..4923fcb --- /dev/null +++ b/home/lf.nix @@ -0,0 +1,40 @@ +{ pkgs, ... }: +{ + programs.lf = { + enable = true; + commands = { + editor-open = ''$$EDITOR $f''; + }; + settings = { + preview = true; + hidden = true; + drawbox = true; + icons = true; + ignorecase = true; + timefmt = "2006-01-02T15:04:05.999Z"; + }; + previewer.source = "/home/petri/.config/lf/pv.sh"; + keybindings = { + ee = "editor-open"; + }; + }; + + xdg.configFile."/home/petri/.config/lf/icons".source = ./icons; + xdg.configFile."/home/petri/.config/lf/pv.sh" = { + executable = true; + source = pkgs.writeShellScript "pv" '' + case "$1" in + *.jpg*) timg -I "$1";; + *.png*) timg -I "$1";; + *.webp*) timg -I "$1";; + *.avif*) timg -I "$1";; + *.tar*) tar tf "$1";; + *.zip) unzip -l "$1";; + *.rar) unrar l "$1";; + *.7z) 7z l "$1";; + *.pdf) pdftotext "$1" -;; + *) pistol "$1";; + esac + ''; + }; +} |
