diff options
| author | Arpit Chakladar <arpitchakladar+git@gmail.com> | 2026-07-23 18:30:05 +0530 |
|---|---|---|
| committer | Arpit Chakladar <arpitchakladar+git@gmail.com> | 2026-07-23 18:42:18 +0530 |
| commit | 5032239a236595451f22ea948c42281f8aa04645 (patch) | |
| tree | 5e6be8235a04614c676d8883c3c756e1b9a5f4ff /modules/file-management | |
| parent | 2ad7b06ced0ffa39d20e6be41466e5bd834ee956 (diff) | |
| download | home-manager-config-5032239a236595451f22ea948c42281f8aa04645.tar.gz home-manager-config-5032239a236595451f22ea948c42281f8aa04645.zip | |
feat: migrate from lf to yazi as default file manager
- Replace lf module with yazi module including base16 theme
- Remove file-preview and file-preview-clean scripts (no longer needed)
- Add yazi-file-chooser script for XDG Desktop Portal integration
- Update i3 keybinding to use yazi
- Add GTK_USE_PORTAL and TERMCMD session variables
- Add extraLinks support to mkScriptModule
Diffstat (limited to 'modules/file-management')
| -rw-r--r-- | modules/file-management/default.nix | 4 | ||||
| -rw-r--r-- | modules/file-management/lf/default.nix | 69 | ||||
| -rw-r--r-- | modules/file-management/lf/icons | 342 | ||||
| -rw-r--r-- | modules/file-management/lf/lfrc | 168 | ||||
| -rw-r--r-- | modules/file-management/yazi/default.nix | 32 | ||||
| -rw-r--r-- | modules/file-management/yazi/theme.nix | 258 |
6 files changed, 292 insertions, 581 deletions
diff --git a/modules/file-management/default.nix b/modules/file-management/default.nix index 5b30f43..f31f998 100644 --- a/modules/file-management/default.nix +++ b/modules/file-management/default.nix @@ -1,9 +1,9 @@ -# File Management - File manager and utility modules (lf, lsd, ouch) +# File Management - File manager and utility modules (yazi, lsd, ouch) { ... }: { imports = [ - ./lf + ./yazi ./lsd ./ouch ]; diff --git a/modules/file-management/lf/default.nix b/modules/file-management/lf/default.nix deleted file mode 100644 index 15d34ae..0000000 --- a/modules/file-management/lf/default.nix +++ /dev/null @@ -1,69 +0,0 @@ -# lf - terminal file manager -{ - pkgs, - lib, - config, - ... -}: -{ - options.file-management.lf = { - enable = lib.mkEnableOption "Enables lf."; - package = lib.mkOption { - type = lib.types.package; - default = pkgs.lf.overrideAttrs (old: { - dontWrapQtApps = true; - dontPatchShebangs = true; - }); - description = "The lf package to use."; - }; - }; - - config = lib.mkIf config.file-management.lf.enable { - assertions = [ - { - assertion = config.scripts.file-preview.enable; - message = "file-management.lf.enable requires scripts.file-preview.enable for file previews."; - } - { - assertion = config.scripts.file-preview-clean.enable; - message = "file-management.lf.enable requires scripts.file-preview-clean.enable to clear kitty previews."; - } - ]; - - xdg.mimeApps.defaultApplications = { - "inode/directory" = "lf.desktop"; - }; - - programs.lf = { - enable = true; - package = config.file-management.lf.package; - settings = { - number = true; - icons = true; - drawbox = true; - hidden = true; - preview = true; - - shell = config.home.sessionVariables.SHELL; - ifs = "\n"; - scrolloff = "4"; - period = "1"; - incsearch = true; - smartcase = true; - info = "size"; - sortby = "natural"; - dirfirst = true; - - cleaner = lib.getExe config.scripts.file-preview-clean.package; - }; - - previewer = { - source = lib.getExe config.scripts.file-preview.package; - }; - - extraConfig = builtins.readFile ./lfrc; - }; - - home.file.".config/lf/icons".source = ./icons; - }; -} diff --git a/modules/file-management/lf/icons b/modules/file-management/lf/icons deleted file mode 100644 index 8697cf2..0000000 --- a/modules/file-management/lf/icons +++ /dev/null @@ -1,342 +0,0 @@ -# vim:ft=conf - -# 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 -*docker-compose.yaml -*compose.yml -*compose.yaml -*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 -*Docker-compose.yaml -*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/modules/file-management/lf/lfrc b/modules/file-management/lf/lfrc deleted file mode 100644 index 7ae847c..0000000 --- a/modules/file-management/lf/lfrc +++ /dev/null @@ -1,168 +0,0 @@ -# ========================= -# BASIC MOVEMENT (nvim-like) -# ========================= - -map j down -map k up -map h updir -map l open - -map gg top -map G bottom - -map <c-u> half-up -map <c-d> half-down - -map <c-b> page-up -map <c-f> page-down - -# ========================= -# SELECTION -# ========================= - -map <space> toggle -map v invert -map V select - -# ========================= -# OPENING -# ========================= - -map o open -map <enter> open -map L open - -# ========================= -# DIRECTORY NAVIGATION -# ========================= - -map H cd .. -map gh cd ~ -map ge cd / - -# ========================= -# FILE OPERATIONS -# ========================= - -map y copy -map x cut -map p paste - -map d delete - -map a :push %mkdir<space> -map A :push %touch<space> - -map r rename - -# ========================= -# SEARCH -# ========================= - -map / search -map n search-next -map N search-prev - -map f find -map F find-back - -# ========================= -# FILTER -# ========================= - -map zf filter -map zc clear - -# ========================= -# MARKS (vim-style) -# ========================= - -map m mark-save -map ' mark-load - -# ========================= -# HISTORY -# ========================= - -map <c-o> history-prev -map <c-i> history-next - -# ========================= -# RELOAD -# ========================= - -map R reload - -# ========================= -# SHELL / COMMANDS -# ========================= - -map ! shell -map : read - -map & shell-async - -# ========================= -# VISUAL MODES / TAGGING -# ========================= - -map t tag -map T tag-toggle - -# ========================= -# SORTING -# ========================= - -map sn set sortby name -map ss set sortby size -map st set sortby time -map se set sortby ext - -# ========================= -# TOGGLES -# ========================= - -map zh set hidden! -map zr set reverse! - -# ========================= -# VIEW -# ========================= - -map zi set info -map zs set preview - -# ========================= -# JUMPS -# ========================= - -map [ jump-prev -map ] jump-next - -# ========================= -# CLIPBOARD-LIKE -# ========================= - -map c clear -map u unselect - -# ========================= -# MULTI-SELECTION NAV -# ========================= - -map J down-select -map K up-select - -# ========================= -# COMMAND MODE SHORTCUTS -# ========================= - -map w :write -map q quit -map Q quit! - -# ========================= -# FILE INFO -# ========================= - -map i info diff --git a/modules/file-management/yazi/default.nix b/modules/file-management/yazi/default.nix new file mode 100644 index 0000000..b43ed5e --- /dev/null +++ b/modules/file-management/yazi/default.nix @@ -0,0 +1,32 @@ +# yazi - Terminal file manager with native previews +{ config, lib, ... }: +{ + imports = [ ./theme.nix ]; + + options.file-management.yazi = { + enable = lib.mkEnableOption "Enables yazi."; + package = lib.mkOption { + type = lib.types.package; + default = config.programs.yazi.finalPackage; + defaultText = lib.literalExpression "config.programs.yazi.finalPackage"; + description = "The yazi package to use. Defaults to the wrapped finalPackage from programs.yazi."; + }; + }; + + config = lib.mkIf config.file-management.yazi.enable { + programs.yazi = { + enable = true; + shellWrapperName = "yy"; + enableZshIntegration = config.terminal.zsh.enable; + settings = { + mgr = { + show_hidden = true; + }; + }; + }; + + xdg.mimeApps.defaultApplications = { + "inode/directory" = "yazi.desktop"; + }; + }; +} diff --git a/modules/file-management/yazi/theme.nix b/modules/file-management/yazi/theme.nix new file mode 100644 index 0000000..e960d84 --- /dev/null +++ b/modules/file-management/yazi/theme.nix @@ -0,0 +1,258 @@ +{ config, lib, ... }: +{ + config = lib.mkIf config.file-management.yazi.enable { + programs.yazi.theme = with config.scheme.withHashtag; { + manager = { + cwd = { + fg = base0D; + }; + + hovered = { + fg = base00; + bg = base0D; + }; + preview_hovered = { + underline = true; + }; + + find_keyword = { + fg = base0A; + italic = true; + }; + find_position = { + fg = base0C; + bg = base00; + italic = true; + }; + + marker_selected = { + fg = base0B; + bg = base0B; + }; + marker_copied = { + fg = base0A; + bg = base0A; + }; + marker_cut = { + fg = base08; + bg = base08; + }; + + tab_active = { + fg = base00; + bg = base0D; + }; + tab_inactive = { + fg = base05; + bg = base01; + }; + + count_copied = { + fg = base00; + bg = base0A; + }; + count_cut = { + fg = base00; + bg = base08; + }; + count_selected = { + fg = base00; + bg = base0B; + }; + + border_symbol = "│"; + border_style = { + fg = base02; + }; + + syntect_theme = ""; + }; + + status = { + separator_open = ""; + separator_close = ""; + separator_style = { + fg = base01; + bg = base01; + }; + + mode_normal_main = { + fg = base00; + bg = base0D; + bold = true; + }; + mode_normal_alt = { + fg = base0D; + bg = base01; + }; + + mode_select_main = { + fg = base00; + bg = base0B; + bold = true; + }; + mode_select_alt = { + fg = base0B; + bg = base01; + }; + + mode_unset_main = { + fg = base00; + bg = base0E; + bold = true; + }; + mode_unset_alt = { + fg = base0E; + bg = base01; + }; + + progress_label = { + fg = base06; + bold = true; + }; + progress_normal = { + fg = base0D; + bg = base01; + }; + progress_error = { + fg = base08; + bg = base01; + }; + + permissions_t = { + fg = base0D; + }; + permissions_r = { + fg = base0A; + }; + permissions_w = { + fg = base08; + }; + permissions_x = { + fg = base0B; + }; + permissions_s = { + fg = base03; + }; + }; + + input = { + border = { + fg = base0D; + }; + selected = { + reversed = true; + }; + }; + + select = { + border = { + fg = base0D; + }; + active = { + fg = base0E; + }; + }; + + tasks = { + border = { + fg = base0D; + }; + hovered = { + underline = true; + }; + }; + + which = { + mask = { + bg = base01; + }; + cand = { + fg = base0C; + }; + rest = { + fg = base04; + }; + desc = { + fg = base0D; + }; + separator = " "; + separator_style = { + fg = base03; + }; + }; + + notify = { + title_info = { + fg = base0D; + }; + title_warn = { + fg = base0A; + }; + title_error = { + fg = base08; + }; + }; + + pick = { + border = { + fg = base0D; + }; + active = { + fg = base0E; + }; + }; + + confirm = { + border = { + fg = base0D; + }; + }; + + completion = { + border = { + fg = base0D; + }; + active = { + fg = base00; + bg = base0D; + }; + icon_file = ""; + icon_folder = ""; + icon_command = ""; + }; + + mode = { + normal_main = { + fg = base00; + bg = base0D; + bold = true; + }; + normal_alt = { + fg = base0D; + bg = base01; + }; + + select_main = { + fg = base00; + bg = base0B; + bold = true; + }; + select_alt = { + fg = base0B; + bg = base01; + }; + + unset_main = { + fg = base00; + bg = base0E; + bold = true; + }; + unset_alt = { + fg = base0E; + bg = base01; + }; + }; + }; + }; +} |
