From f357ee61fae2cb53639fa0c7d430a783008d61f8 Mon Sep 17 00:00:00 2001 From: aleidk Date: Fri, 9 Jan 2026 14:14:16 -0300 Subject: [PATCH] update yazi config --- configs/hypr/base/hypridle.conf | 8 +++---- configs/yazi/init.lua | 10 ++++++++ configs/yazi/keymap.toml | 12 +++++++++- configs/yazi/package.toml | 30 +++++++++++++++++++++++ configs/yazi/vfs.toml | 1 + configs/yazi/yazi.toml | 42 ++------------------------------- 6 files changed, 58 insertions(+), 45 deletions(-) create mode 100644 configs/yazi/vfs.toml diff --git a/configs/hypr/base/hypridle.conf b/configs/hypr/base/hypridle.conf index d96ac12..0ca4130 100644 --- a/configs/hypr/base/hypridle.conf +++ b/configs/hypr/base/hypridle.conf @@ -1,7 +1,7 @@ general { - lock_cmd = pidof hyprlock || hyprlock # avoid starting multiple hyprlock instances. - before_sleep_cmd = loginctl lock-session # lock before suspend. - after_sleep_cmd = niri msg action power-on-monitors # to avoid having to press a key twice to turn on the display. + lock_cmd = qs -c noctalia-shell ipc call lockScreen lock # avoid starting multiple hyprlock instances. + before_sleep_cmd = loginctl lock-session # lock before suspend. + after_sleep_cmd = niri msg action power-on-monitors # to avoid having to press a key twice to turn on the display. } listener { @@ -23,7 +23,7 @@ listener { } listener { - timeout = 330 # 5.5min + timeout = 600 # 5.5min on-timeout = niri msg action power-off-monitors # screen off when timeout has passed on-resume = niri msg action power-on-monitors && brightnessctl -r # screen on when activity is detected after timeout has fired. } diff --git a/configs/yazi/init.lua b/configs/yazi/init.lua index 6c283c4..8572cb2 100644 --- a/configs/yazi/init.lua +++ b/configs/yazi/init.lua @@ -1 +1,11 @@ require("full-border"):setup() +require("recycle-bin"):setup() + +require("restore"):setup({ + -- Show confirm prompt before restore. + -- NOTE: even if set this to false, overwrite prompt still pop up + show_confirm = false, -- Optional + + -- Suppress success notification when all files or folder are restored. + suppress_success_notification = false, -- Optional +}) diff --git a/configs/yazi/keymap.toml b/configs/yazi/keymap.toml index c20f2ca..80ee09b 100644 --- a/configs/yazi/keymap.toml +++ b/configs/yazi/keymap.toml @@ -16,17 +16,25 @@ prepend_keymap = [ { on = [""], run = ["enter", "escape --visual --select"], desc = "Enter the child directory" }, # Operation + { on = ["C"], run = "plugin ouch", desc = "Compress" }, { on = ["r"], run = "rename --empty=stem --cursor=start", desc = "Rename a file or directory" }, { on = ["R"], run = "rename --cursor=end", desc = "Rename a file or directory (keeping the current filename)" }, + { on = ["d", "d"], run = "remove --force", desc = "Trash selected files" }, + { on = ["d", "D"], run = "remove --permanently", desc = "Permanently delete selected files" }, + { on = ["d", "t"], run = "plugin recycle-bin", desc = "Open Recycle Bin menu" }, + { on = ["d", "u"], run = "plugin restore", desc = "Restore last deleted files/folders" }, + # Copy - { on = ["c", "c"], run = "copy path", desc = "Copy the absolute path" }, + { on = ["c", "c"], run = "plugin wl-clipboard", desc = "Copy file content" }, + { on = ["c", "p"], run = "copy path", desc = "Copy the absolute path" }, { on = ["c", "d"], run = "copy dirname", desc = "Copy the path of the parent directory" }, { on = ["c", "f"], run = "copy filename", desc = "Copy the name of the file" }, { on = ["c", "n"], run = "copy name_without_ext", desc = "Copy the name of the file without the extension" }, { on = ["c", "r"], run = "plugin rsync", desc = "Copy files using rsync" }, # Goto + { on = ["g", "r"], run = "plugin cd-git-root", desc = "Go to git repo root" }, { on = ["g", "h"], run = "cd ~", desc = "Go home" }, { on = ["g", "c"], run = "cd ~/.config", desc = "Goto ~/.config" }, { on = ["g", "d"], run = "cd ~/Downloads", desc = "Goto ~/Downloads" }, @@ -45,6 +53,8 @@ prepend_keymap = [ { on = ["", "d"], run = ["shell 'ya pub-to 0 DiffRemote --orphan --list \"$@\"'", "quit"], desc = "Diff with transfer.nvim" }, { on = ["", ""], run = ["shell 'ya pub-to 0 TransferDirDiff --list \"$@\"'"], desc = "Diff directory with transfer.nvim" }, + # File Info + { on = ["m", "S"], run = "plugin what-size", desc = "Show size of selection or CWD" }, ] [input] diff --git a/configs/yazi/package.toml b/configs/yazi/package.toml index 14b4153..78f9b0a 100644 --- a/configs/yazi/package.toml +++ b/configs/yazi/package.toml @@ -13,6 +13,36 @@ use = "yazi-rs/plugins:smart-enter" rev = "68f7d48" hash = "56fdabc96fc1f4d53c96eb884b02a5be" +[[plugin.deps]] +use = "ciarandg/cd-git-root" +rev = "a0e0f4b" +hash = "b84a85f3b513bd9c0a0ab93cc7c8e4c3" + +[[plugin.deps]] +use = "pirafrank/what-size" +rev = "179ebf6" +hash = "57056b9728006881d580ccabe8154a9c" + +[[plugin.deps]] +use = "uhs-robert/recycle-bin" +rev = "69d7d4c" +hash = "38dac2fc8f4b50bbdaa46e699720a54a" + +[[plugin.deps]] +use = "boydaihungst/restore" +rev = "4eda0bf" +hash = "778941e7f1ebbacd60f4e254bb3c51de" + +[[plugin.deps]] +use = "grappas/wl-clipboard" +rev = "e9a38e4" +hash = "6b8e5d6b09626facec713923d3ddb54b" + +[[plugin.deps]] +use = "ndtoan96/ouch" +rev = "cfb9140" +hash = "b5067143415bd2d46c0dfa57319ddcef" + [[flavor.deps]] use = "yazi-rs/flavors:catppuccin-macchiato" rev = "4a1802a" diff --git a/configs/yazi/vfs.toml b/configs/yazi/vfs.toml new file mode 100644 index 0000000..48be1da --- /dev/null +++ b/configs/yazi/vfs.toml @@ -0,0 +1 @@ +[services] diff --git a/configs/yazi/yazi.toml b/configs/yazi/yazi.toml index 3a64e39..d773506 100644 --- a/configs/yazi/yazi.toml +++ b/configs/yazi/yazi.toml @@ -16,7 +16,7 @@ mouse_events = ["click", "scroll"] title_format = "Yazi: {cwd}" [preview] -cache_dir = "" +cache_dir = "$HOME/.cache/yazi" image_delay = 0 image_filter = "triangle" image_quality = 75 @@ -72,46 +72,8 @@ image_bound = [0, 0] suppress_preload = false [plugin] +prepend_previewers = [{ mime = "application/{*zip,tar,bzip2,7z*,rar,xz,zstd,java-archive}", run = "ouch --show-file-icons" }] -fetchers = [ - # Mimetype - { id = "mime", url = "*", run = "mime", if = "!mime", prio = "high" }, -] -preloaders = [ - # example - { mime = "image/{avif,heic,jxl,svg+xml}", run = "magick" }, - { mime = "image/*", run = "image" }, - # Video - { mime = "video/*", run = "video" }, - # PDF - { mime = "application/pdf", run = "pdf" }, - # Font - { mime = "font/*", run = "font" }, - { mime = "application/vnd.ms-opentype", run = "font" }, -] -previewers = [ - { url = "*/", run = "folder", sync = true }, - # Code - { mime = "text/*", run = "code" }, - { mime = "*/{xml,javascript,x-wine-extension-ini}", run = "code" }, - # JSON - { mime = "application/{json,x-ndjson}", run = "json" }, - # Image - { mime = "image/{avif,hei?,jxl,svg+xml}", run = "magick" }, - { mime = "image/*", run = "image" }, - # Video - { mime = "video/*", run = "video" }, - # PDF - { mime = "application/pdf", run = "pdf" }, - # Archive - { mime = "application/{,g}zip", run = "archive" }, - { mime = "application/x-{tar,bzip*,7z-compressed,xz,rar,iso9660-image}", run = "archive" }, - # Font - { mime = "font/*", run = "font" }, - { mime = "application/vnd.ms-opentype", run = "font" }, - # Fallback - { url = "*", run = "file" }, -] [input] cursor_blink = false