{ pkgs, system, rice, inputs, ... }: { home.packages = with pkgs; [ # yazi # dragon unar ]; programs.yazi = { enable = true; # package = pkgs.yazi; package = inputs.yazi.packages.${system}.default; enableFishIntegration = true; shellWrapperName = "ya"; plugins = with inputs.yazi-plugins.packages.${system}; { inherit chmod starship; }; # initLua = /* lua */ '' ''; keymap = { keymap = [ { on = ""; run = "escape"; desc = "Exit visual mode, clear selected, or cancel search"; } { on = "q"; run = "quit"; desc = "Exit the process"; } { on = "Q"; run = "quit --no-cwd-file"; desc = "Exit the process without writing cwd-file"; } { on = ""; run = "close"; desc = "Close the current tab, or quit if it is last tab"; } { on = ""; run = "suspend"; desc = "Suspend the process"; } # Hopping { on = "k"; run = "arrow -1"; desc = "Move cursor up"; } { on = "j"; run = "arrow 1"; desc = "Move cursor down"; } { on = ""; run = "arrow -1"; desc = "Move cursor up"; } { on = ""; run = "arrow 1"; desc = "Move cursor down"; } { on = ""; run = "arrow -50%"; desc = "Move cursor up half page"; } { on = ""; run = "arrow 50%"; desc = "Move cursor down half page"; } { on = ""; run = "arrow -100%"; desc = "Move cursor up one page"; } { on = ""; run = "arrow 100%"; desc = "Move cursor down one page"; } { on = ""; run = "arrow -100%"; desc = "Move cursor up one page"; } { on = ""; run = "arrow 100%"; desc = "Move cursor down one page"; } { on = [ "g" "g" ]; run = "arrow -99999999"; desc = "Move cursor to the top"; } { on = [ "g" "e" ]; run = "arrow 99999999"; desc = "Move cursor to the end"; } { on = [ "g" "h" ]; run = "cd ~"; desc = "Go to the home directory"; } { on = [ "g" "n" ]; run = "cd ~/nix-dots"; desc = "Go to the Nix-Dotfiles directory"; } { on = [ "g" "n" ]; run = "cd /nix/store"; desc = "Go to the Nix-Store"; } { on = [ "g" "c" ]; run = "cd ~/.config"; desc = "Go to the config directory"; } { on = [ "g" "l" ]; run = "cd ~/.locale"; desc = "Go to the .locale directory"; } { on = [ "g" "C" ]; run = "cd ~/.cache"; desc = "Go to the .cache directory"; } { on = [ "g" "m" ]; run = "cd ~/media"; desc = "Go to the media (udiskie mount) directory"; } { on = [ "g" "v" ]; run = "cd ~/Videos"; desc = "Go to the Videos directory"; } { on = [ "g" "d" ]; run = "cd ~/Downloads"; desc = "Go to the downloads directory"; } { on = [ "g" "D" ]; run = "cd ~/Documents"; desc = "Go to the Documents directory"; } { on = [ "g" "r" ]; run = "cd /"; desc = "Go to the root (/) directory"; } { on = [ "g" "/" ]; run = "cd /"; desc = "Go to the root (/) directory"; } { on = [ "g" "" ]; run = "cd --interactive"; desc = "Go to a directory interactively"; } # Navigation { on = "h"; run = "leave"; desc = "Go back to the parent directory"; } { on = "l"; run = "enter"; desc = "Enter the child directory"; } { on = ""; run = "leave"; desc = "Go back to the parent directory"; } { on = ""; run = "enter"; desc = "Enter the child directory"; } { on = "H"; run = "back"; desc = "Go back to the previous directory"; } { on = "L"; run = "forward"; desc = "Go forward to the next directory"; } # Seeking { on = "K"; run = "seek -5"; desc = "Seek up 5 units in the preview"; } { on = "J"; run = "seek 5"; desc = "Seek down 5 units in the preview"; } # Selection { on = ""; run = [ "select --state=none" "arrow 1" ]; desc = "Toggle the current selection state"; } { on = "v"; run = "visual_mode"; desc = "Enter visual mode (selection mode)"; } { on = "V"; run = "visual_mode --unset"; desc = "Enter visual mode (unset mode)"; } { on = ""; run = "select_all --state=true"; desc = "Select all files"; } { on = ""; run = "select_all --state=none"; desc = "Inverse selection of all files"; } # Operation { on = "o"; run = "open"; desc = "Open selected files"; } { on = "O"; run = "open --interactive"; desc = "Open selected files interactively"; } { on = ""; run = "open"; desc = "Open selected files"; } { on = ""; run = "open --interactive"; desc = "Open selected files interactively"; } { on = "y"; run = "yank"; desc = "Yank selected files (copy)"; } { on = "x"; run = "yank --cut"; desc = "Yank selected files (cut)"; } { on = "p"; run = "paste"; desc = "Paste yanked "; } { on = "P"; run = "paste --force"; desc = "Paste yanked (overwrite if exists)"; } { on = "-"; run = "link"; desc = "Symlink the absolute path of yanked files"; } { on = "_"; run = "link --relative"; desc = "Symlink the relative path of yanked files"; } { on = ""; run = "hardlink"; desc = "Hardlink yanked files"; } { on = "Y"; run = "unyank"; desc = "Cancel the yank status"; } { on = "X"; run = "unyank"; desc = "Cancel the yank status"; } { on = "d"; run = "remove"; desc = "Trash selected files"; } { on = "D"; run = "remove --permanently"; desc = "Permanently delete selected files"; } { on = "a"; run = "create"; desc = "Create a file (ends with / for directories)"; } { on = "r"; run = "rename --cursor=before_ext"; desc = "Rename selected file(s)"; } { on = ";"; run = "shell --interactive"; desc = "Run a shell command"; } { on = ":"; run = "shell --block --interactive"; desc = "Run a shell command (block until finishes)"; } { on = "."; run = "hidden toggle"; desc = "Toggle the visibility of hidden files"; } { on = "s"; run = "search fd"; desc = "Search files by name using fd"; } { on = "S"; run = "search rg"; desc = "Search files by content using ripgrep"; } { on = ""; run = "escape --search"; desc = "Cancel the ongoing search"; } { on = "z"; run = "plugin zoxide"; desc = "Jump to a directory using zoxide"; } { on = "Z"; run = "plugin fzf"; desc = "Jump to a directory or reveal a file using fzf"; } # Linemode { on = [ "m" "s" ]; run = "linemode size"; desc = "Set linemode to size"; } { on = [ "m" "p" ]; run = "linemode permissions"; desc = "Set linemode to permissions"; } { on = [ "m" "c" ]; run = "linemode ctime"; desc = "Set linemode to ctime"; } { on = [ "m" "m" ]; run = "linemode mtime"; desc = "Set linemode to mtime"; } { on = [ "m" "o" ]; run = "linemode owner"; desc = "Set linemode to owner"; } { on = [ "m" "n" ]; run = "linemode none"; desc = "Set linemode to none"; } # Copy { on = [ "c" "c" ]; run = "copy path"; desc = "Copy the file path"; } { on = [ "c" "d" ]; run = "copy dirname"; desc = "Copy the directory path"; } { on = [ "c" "f" ]; run = "copy filename"; desc = "Copy the filename"; } { on = [ "c" "n" ]; run = "copy name_without_ext"; desc = "Copy the filename without extension"; } # Filter { on = "f"; run = "filter --smart"; desc = "Filter files"; } # Find { on = "/"; run = "find --smart"; desc = "Find next file"; } { on = "?"; run = "find --previous --smart"; desc = "Find previous file"; } { on = "n"; run = "find_arrow"; desc = "Go to the next found"; } { on = "N"; run = "find_arrow --previous"; desc = "Go to the previous found"; } # Sortin { on = [ "," "m" ]; run = [ "sort modified --reverse=no" "linemode mtime" ]; desc = "Sort by modified time"; } { on = [ "," "M" ]; run = [ "sort modified --reverse" "linemode mtime" ]; desc = "Sort by modified time (reverse)"; } { on = [ "," "c" ]; run = [ "sort created --reverse=no" "linemode ctime" ]; desc = "Sort by created time"; } { on = [ "," "C" ]; run = [ "sort created --reverse" "linemode ctime" ]; desc = "Sort by created time (reverse)"; } { on = [ "," "e" ]; run = "sort extension --reverse=no"; desc = "Sort by extension"; } { on = [ "," "E" ]; run = "sort extension --reverse"; desc = "Sort by extension (reverse)"; } { on = [ "," "a" ]; run = "sort alphabetical --reverse=no"; desc = "Sort alphabetically"; } { on = [ "," "A" ]; run = "sort alphabetical --reverse"; desc = "Sort alphabetically (reverse)"; } { on = [ "," "n" ]; run = "sort natural --reverse=no"; desc = "Sort naturally"; } { on = [ "," "N" ]; run = "sort natural --reverse"; desc = "Sort naturally (reverse)"; } { on = [ "," "s" ]; run = [ "sort size --reverse=no" "linemode size" ]; desc = "Sort by size"; } { on = [ "," "S" ]; run = [ "sort size --reverse" "linemode size" ]; desc = "Sort by size (reverse)"; } # Tab { on = "t"; run = "tab_create --current"; desc = "Create a new tab with CWD"; } { on = "1"; run = "tab_switch 0"; desc = "Switch to the first tab"; } { on = "2"; run = "tab_switch 1"; desc = "Switch to the second tab"; } { on = "3"; run = "tab_switch 2"; desc = "Switch to the third tab"; } { on = "4"; run = "tab_switch 3"; desc = "Switch to the fourth tab"; } { on = "5"; run = "tab_switch 4"; desc = "Switch to the fifth tab"; } { on = "6"; run = "tab_switch 5"; desc = "Switch to the sixth tab"; } { on = "7"; run = "tab_switch 6"; desc = "Switch to the seventh tab"; } { on = "8"; run = "tab_switch 7"; desc = "Switch to the eighth tab"; } { on = "9"; run = "tab_switch 8"; desc = "Switch to the ninth tab"; } { on = "["; run = "tab_switch -1 --relative"; desc = "Switch to the previous tab"; } { on = "]"; run = "tab_switch 1 --relative"; desc = "Switch to the next tab"; } { on = "{"; run = "tab_swap -1"; desc = "Swap current tab with previous tab"; } { on = "}"; run = "tab_swap 1"; desc = "Swap current tab with next tab"; } # Task { on = "w"; run = "tasks_show"; desc = "Show task manager"; } # Hel { on = "~"; run = "help"; desc = "Open help"; } { on = ""; run = "help"; desc = "Open help"; } ]; }; settings = { manager = { layout = [2 3 4]; sort_by = "natural"; sort_sensitive = true; sort_reverse = false; sort_dir_first = true; linemode = "size"; show_hidden = false; show_symlink = true; }; opener = { "edit" = [ { run = ''hx "$@"''; desc = "helix"; block = true; } { run = ''codium "$@"''; desc = "helix"; orphan = true; } ]; "play" = [ { run = ''mpv "$@"''; } { run = ''mediainfo "$1"; echo "Press enter to exit"; read''; block = true; desc = "Show mediainfo"; } ]; "archive" = [ { run = ''unar "$1"''; desc = "Extract here"; } { run = ''tar -x "$1"''; desc = "tar -x"; } { run = ''unzip "$1"''; desc = "unzip"; } ]; "image" = [ { run = ''imv "$@"''; desc = "imv"; } { run = ''gimp "$@"''; desc = "gimp"; } { run = ''swww img --transition-type wipe --transition-angle 60 --transition-step 120 --transition-fps 120 "$@"''; desc = "swww wallpaper"; } ]; "svg" = [ { run = ''inkscape "$@"''; desc = "inkscape";} { run = ''firefoc "$@"''; desc = "firefox";} ]; "font" = [ { run = ''fontpreview "$@"''; desc = "fontpreview"; } { run = ''fontforge "$@"''; desc = "fortforge"; } ]; "document" = [ { run = ''zathura "$@"''; desc = "zathura"; orphan = true; } { run = ''xournal "$@"''; desc = "xournal"; orphan = true; } { run = ''firefox "$@"''; desc = "firefox"; } { run = ''nxgs flip "$@"''; desc = "nxgs flip"; } { run = ''nxgs rotate "$@"''; desc = "nxgs rotate"; } { run = ''nxgs interactive-merge "$@"''; block = true; desc = "nxgs merge"; } ]; "browser" = [ { run = ''firefox "$@"''; desc = "firefox"; } { run = ''zen "$@"''; desc = "zen"; } { run = ''chromium --enable-features=UseOzonePlatform --ozone-platform=wayland "$@"''; desc = "chromium"; } { run = ''w3m "$@"''; desc = "w3m"; } { run = ''lynx "$@"''; desc = "lynx"; } ]; "office" = [ { run = ''libreoffice "$@"''; desc = "libreoffice"; } { run = ''libreoffice --view "$@"''; desc = "libreoffice read-only"; } ]; "shell" = [ { run = ''bash -c "$@"''; desc = "bash -c"; } { run = ''fish -c "$@"''; desc = "fish -c"; } { run = ''sh -c "$@"''; desc = "sh -c"; } ]; "python" = [ { run = ''python "$@"''; desc = "python"; } ]; "directory" = [ { run = ''lazygit "$@"''; desc = "python"; } ]; }; open.rules = [ { mime = "text/html"; use = [ "edit" "browser" ]; } { mime = "text/htm"; use = [ "edit" "browser" ]; } { mime = "text/x-python"; use = "python"; } { mime = "text/*"; use = "edit"; } { mine = "inode/x-empty"; use = "edit"; } { mine = "inode/directory"; use = "edit"; } { mime = "image/*"; use = "image"; } { mime = "image/svg"; use = [ "image" "edit" ]; } { mime = "video/*"; use = "play"; } { mime = "audio/*"; use = "play"; } { mime = "application/x-httpd-php"; use = [ "edit" "browser" ]; } { mime = "application/json"; use = "edit"; } { mime = "application/ld+json"; use = "edit"; } { mime = "application/pdf"; use = "document"; } { mime = "application/epub"; use = "document"; } { mime = "application/vnd.oasis.opendocument.*"; use = "office"; } { mime = "application/vnd.ms-powerpoint"; use = "office"; } { mime = "application/vnd.ms-excel"; use = "office"; } { mime = "application/vnd.openxmlformats-officedocument.*"; use = [ "office" "edit" ]; } { mime = "application/rtf"; use = "office"; } { mime = "application/x-sh"; use = [ "edit" "shell" ]; } { mime = "application/x-python-code"; use = "python"; } { mime = "application/xml"; use = "edit"; } { mime = "application/xul"; use = "edit"; } { mime = "application/x-bzip"; use = "archive"; } { mime = "application/x-bzip2"; use = "archive"; } { mime = "application/gzip"; use = "archive"; } { mime = "application/vnd.rar"; use = "archive"; } { mime = "application/x-tar"; use = "archive"; } { mime = "application/zip"; use = "archive"; } { mime = "application/x-7z-compressed"; use = "archive"; } ]; }; theme = with rice.color; { manager = { cwd = { fg = foreground; bg = background; }; hovered = { fg = background; bg = accent.base; }; preview_hovered = { underline = false; }; find_keyword = { fg = weird.base; italic = true; }; find_position = { fg = weird.base; bg = "reset"; italic = true; }; marker_selected = { fg = accent.base; bg = accent.base; }; marker_copied = { fg = weird.base; bg = weird.base; }; marker_cut = { fg = negative.base; bg = negative.base; }; tab_active = { fg = background; bg = accent.base; }; tab_inactive = { fg = accent.base; bg = background; }; tab_width = 1; border_symbol = "│"; border_style = { fg = border; }; }; status = { separator_open = " "; #""; separator_close = " "; #""; separator_style = { fg = accent.base; bg = black.base; }; mode_normal = { fg = yellow.bright; bg = yellow.dark; }; mode_select = { fg = cyan.bright; bg = cyan.dark; }; mode_unset = { fg = blue.bright; bg = blue.dark; }; progress_label = { fg = secondary.base; bold = true; }; progress_normal = { fg = accent.base; bg = black.base; }; progress_error = { fg = negative.base; bg = black.base; }; permissions_t = { fg = special.base; }; permissions_r = { fg = accent.base; }; permissions_w = { fg = secondary.base; }; permissions_x = { fg = tertiary.base; }; permissions_s = { fg = special.base; }; }; input = { border = { fg = border; }; title = {}; value = {}; selected = { reversed = true; }; }; select = { border = { fg = border; }; active = { fg = accent.base; }; inactive = {}; }; tasks = { border = { fg = border2; }; title = {}; hovered = { underline = true; }; }; which = { mask = { bg = black.base; }; cand = { fg = accent.base; }; rest = { fg = secondary.base; }; desc = { fg = tertiary.base; }; separator = "  "; separator_style = { fg = foreground; }; }; help = { on = { fg = "#fe8019"; }; exec = { fg = "#83a598"; }; desc = { fg = "#928374"; }; hovered = { bg = "#504945"; bold = true; }; footer = { fg = "#3c3836"; bg = "#a89984"; }; }; filetype = { rules = [ # Empty files { mime = "inode/x-empty"; fg = white.dark; } { mime = "inode/directory"; fg = accent.base; } { name = "*"; is = "link"; fg = tertiary.base; } { name = "*"; is = "orphan"; fg = negative.base; } { name = "*"; is = "block"; fg = special.base; } { name = "*"; is = "char"; fg = special.bright; } { name = "*"; is = "exec"; fg = secondary.base; } { name = "*"; is = "fifo"; fg = weird.base; } { name = "*"; is = "sock"; fg = weird.bright; } { name = "*"; is = "sticky"; fg = special.base; } # Fallback { name = "*"; fg = foreground; } ]; }; }; }; }