From 3240f76822746b0e4e43fb2c6fd0feb1beb6cc1e Mon Sep 17 00:00:00 2001 From: Aria Nolan Date: Tue, 2 Jan 2024 20:55:35 -0500 Subject: [PATCH] lf --- modules/nixos-common.nix | 1 + users/tacocat/home.nix | 4 +- users/tacocat/lf/default.nix | 62 +++++ users/tacocat/lf/icons | 357 +++++++++++++++++++++++++++++ users/tacocat/programs/default.nix | 1 - 5 files changed, 423 insertions(+), 2 deletions(-) create mode 100644 users/tacocat/lf/default.nix create mode 100644 users/tacocat/lf/icons diff --git a/modules/nixos-common.nix b/modules/nixos-common.nix index a2ba87c..78bce4f 100644 --- a/modules/nixos-common.nix +++ b/modules/nixos-common.nix @@ -77,6 +77,7 @@ "nvidia-settings" "discord" "spotify" + "unrar" ]; programs.nix-index.enable = true; diff --git a/users/tacocat/home.nix b/users/tacocat/home.nix index 1efcc8e..a3aa53e 100644 --- a/users/tacocat/home.nix +++ b/users/tacocat/home.nix @@ -15,6 +15,7 @@ packages = with pkgs; [ mpv krita + tree gimp r2modman rtorrent @@ -45,7 +46,6 @@ (nerdfonts.override {fonts = ["FiraCode"];}) gnupg pandoc - maven pdftk git lua @@ -74,6 +74,7 @@ ./helix ./wayland ./email.nix + ./lf ]; xdg = { @@ -88,6 +89,7 @@ # Let Home Manager install and manage itself. programs.home-manager.enable = true; + # ------------ GTK ------------ gtk = { diff --git a/users/tacocat/lf/default.nix b/users/tacocat/lf/default.nix new file mode 100644 index 0000000..ab3c2eb --- /dev/null +++ b/users/tacocat/lf/default.nix @@ -0,0 +1,62 @@ +{pkgs, ...}: { + xdg.configFile."lf/icons".source = ./icons; + + programs.lf = { + enable = true; + commands = { + dragon-out = ''%${pkgs.xdragon}/bin/xdragon -a -x "$fx"''; + editor-open = ''$$EDITOR $f''; + mkdir = '' + ''${{ + printf "Directory Name: " + read DIR + mkdir $DIR + }} + ''; + }; + keybindings = { + "\\\"" = ""; + o = ""; + m = ""; + mm = "mark-save"; + md = "mkdir"; + "." = "set hidden!"; + "`" = "mark-load"; + "\\'" = "mark-load"; + "" = "open"; + + d = ""; + do = "dragon-out"; + dd = "cut"; + + "g~" = "cd"; + gh = "cd"; + "g/" = "/"; + + ee = "editor-open"; + V = ''$${pkgs.bat}/bin/bat --paging=always "$f"''; + }; + settings = { + preview = true; + hidden = true; + drawbox = true; + icons = true; + ignorecase = true; + tabstop = 2; + }; + previewer = { + keybinding = "i"; + source = pkgs.writeShellScript "pv.sh" '' + #!/bin/sh + case "$1" in + *.tar*) ${pkgs.gnutar}/bin/tar tf "$1";; + *.zip) ${pkgs.unzip}/bin/unzip -l "$1";; + *.rar) ${pkgs.unrar}/bin/unrar l "$1";; + *.7z) ${pkgs.p7zip}/bin/7z l "$1";; + *.pdf) ${pkgs.poppler_utils}/bin/pdftotext "$1" -;; + *) ${pkgs.highlight}/bin/highlight -O ansi "$1" || cat "$1";; + esac + ''; + }; + }; +} diff --git a/users/tacocat/lf/icons b/users/tacocat/lf/icons new file mode 100644 index 0000000..404f9e5 --- /dev/null +++ b/users/tacocat/lf/icons @@ -0,0 +1,357 @@ +# vim:ft=conf + +# These examples require Nerd Fonts or a compatible font to be used. +# See https://www.nerdfonts.com for more information. + +# default values from lf (with matching order) +# ln l # LINK +# or l # ORPHAN +# tw t # STICKY_OTHER_WRITABLE +# ow d # OTHER_WRITABLE +# st t # STICKY +# di d # DIR +# pi p # FIFO +# so s # SOCK +# bd b # BLK +# cd c # CHR +# su u # SETUID +# sg g # SETGID +# ex x # EXEC +# fi - # FILE + +# file types (with matching order) +ln  # LINK +or  # ORPHAN +tw t # STICKY_OTHER_WRITABLE +ow  # OTHER_WRITABLE +st t # STICKY +di  # DIR +pi p # FIFO +so s # SOCK +bd b # BLK +cd c # CHR +su u # SETUID +sg g # SETGID +ex  # EXEC +fi  # FILE + +# file extensions (vim-devicons) +*.styl  +*.sass  +*.scss  +*.htm  +*.html  +*.slim  +*.haml  +*.ejs  +*.css  +*.less  +*.md  +*.mdx  +*.markdown  +*.rmd  +*.json  +*.webmanifest  +*.js  +*.mjs  +*.jsx  +*.rb  +*.gemspec  +*.rake  +*.php  +*.py  +*.pyc  +*.pyo  +*.pyd  +*.coffee  +*.mustache  +*.hbs  +*.conf  +*.ini  +*.yml  +*.yaml  +*.toml  +*.bat  +*.mk  +*.jpg  +*.jpeg  +*.bmp  +*.png  +*.webp  +*.gif  +*.ico  +*.twig  +*.cpp  +*.c++  +*.cxx  +*.cc  +*.cp  +*.c  +*.cs 󰌛 +*.h  +*.hh  +*.hpp  +*.hxx  +*.hs  +*.lhs  +*.nix  +*.lua  +*.java  +*.sh  +*.fish  +*.bash  +*.zsh  +*.ksh  +*.csh  +*.awk  +*.ps1  +*.ml λ +*.mli λ +*.diff  +*.db  +*.sql  +*.dump  +*.clj  +*.cljc  +*.cljs  +*.edn  +*.scala  +*.go  +*.dart  +*.xul  +*.sln  +*.suo  +*.pl  +*.pm  +*.t  +*.rss  +'*.f#'  +*.fsscript  +*.fsx  +*.fs  +*.fsi  +*.rs  +*.rlib  +*.d  +*.erl  +*.hrl  +*.ex  +*.exs  +*.eex  +*.leex  +*.heex  +*.vim  +*.ai  +*.psd  +*.psb  +*.ts  +*.tsx  +*.jl  +*.pp  +*.vue  +*.elm  +*.swift  +*.xcplayground  +*.tex 󰙩 +*.r 󰟔 +*.rproj 󰗆 +*.sol 󰡪 +*.pem  + +# file names (vim-devicons) (case-insensitive not supported in lf) +*gruntfile.coffee  +*gruntfile.js  +*gruntfile.ls  +*gulpfile.coffee  +*gulpfile.js  +*gulpfile.ls  +*mix.lock  +*dropbox  +*.ds_store  +*.gitconfig  +*.gitignore  +*.gitattributes  +*.gitlab-ci.yml  +*.bashrc  +*.zshrc  +*.zshenv  +*.zprofile  +*.vimrc  +*.gvimrc  +*_vimrc  +*_gvimrc  +*.bashprofile  +*favicon.ico  +*license  +*node_modules  +*react.jsx  +*procfile  +*dockerfile  +*docker-compose.yml  +*rakefile  +*config.ru  +*gemfile  +*makefile  +*cmakelists.txt  +*robots.txt 󰚩 + +# file names (case-sensitive adaptations) +*Gruntfile.coffee  +*Gruntfile.js  +*Gruntfile.ls  +*Gulpfile.coffee  +*Gulpfile.js  +*Gulpfile.ls  +*Dropbox  +*.DS_Store  +*LICENSE  +*React.jsx  +*Procfile  +*Dockerfile  +*Docker-compose.yml  +*Rakefile  +*Gemfile  +*Makefile  +*CMakeLists.txt  + +# file patterns (vim-devicons) (patterns not supported in lf) +# .*jquery.*\.js$  +# .*angular.*\.js$  +# .*backbone.*\.js$  +# .*require.*\.js$  +# .*materialize.*\.js$  +# .*materialize.*\.css$  +# .*mootools.*\.js$  +# .*vimrc.*  +# Vagrantfile$  + +# file patterns (file name adaptations) +*jquery.min.js  +*angular.min.js  +*backbone.min.js  +*require.min.js  +*materialize.min.js  +*materialize.min.css  +*mootools.min.js  +*vimrc  +Vagrantfile  + +# archives or compressed (extensions from dircolors defaults) +*.tar  +*.tgz  +*.arc  +*.arj  +*.taz  +*.lha  +*.lz4  +*.lzh  +*.lzma  +*.tlz  +*.txz  +*.tzo  +*.t7z  +*.zip  +*.z  +*.dz  +*.gz  +*.lrz  +*.lz  +*.lzo  +*.xz  +*.zst  +*.tzst  +*.bz2  +*.bz  +*.tbz  +*.tbz2  +*.tz  +*.deb  +*.rpm  +*.jar  +*.war  +*.ear  +*.sar  +*.rar  +*.alz  +*.ace  +*.zoo  +*.cpio  +*.7z  +*.rz  +*.cab  +*.wim  +*.swm  +*.dwm  +*.esd  + +# image formats (extensions from dircolors defaults) +*.jpg  +*.jpeg  +*.mjpg  +*.mjpeg  +*.gif  +*.bmp  +*.pbm  +*.pgm  +*.ppm  +*.tga  +*.xbm  +*.xpm  +*.tif  +*.tiff  +*.png  +*.svg  +*.svgz  +*.mng  +*.pcx  +*.mov  +*.mpg  +*.mpeg  +*.m2v  +*.mkv  +*.webm  +*.ogm  +*.mp4  +*.m4v  +*.mp4v  +*.vob  +*.qt  +*.nuv  +*.wmv  +*.asf  +*.rm  +*.rmvb  +*.flc  +*.avi  +*.fli  +*.flv  +*.gl  +*.dl  +*.xcf  +*.xwd  +*.yuv  +*.cgm  +*.emf  +*.ogv  +*.ogx  + +# audio formats (extensions from dircolors defaults) +*.aac  +*.au  +*.flac  +*.m4a  +*.mid  +*.midi  +*.mka  +*.mp3  +*.mpc  +*.ogg  +*.ra  +*.wav  +*.oga  +*.opus  +*.spx  +*.xspf  + +# other formats +*.pdf  diff --git a/users/tacocat/programs/default.nix b/users/tacocat/programs/default.nix index 42609b2..8be9f22 100644 --- a/users/tacocat/programs/default.nix +++ b/users/tacocat/programs/default.nix @@ -7,7 +7,6 @@ ./vscode.nix ./fzf.nix ./tmux.nix - # ./thunderbird.nix ]; programs.eza = {