From 04e5f213d474ba6b70dfefd895ed6ff4c91a7c36 Mon Sep 17 00:00:00 2001 From: Michel Fedde Date: Sun, 23 Feb 2025 22:36:48 +0100 Subject: [PATCH] Adds yazi --- .../xfconf/xfce-perchannel-xml/thunar.xml | 1 + .config/yazi/init.lua | 95 +++++++++++++++++++ .config/yazi/keymap.toml | 12 ++- .config/yazi/package.toml | 42 ++++++++ .config/yazi/yazi.toml | 8 ++ .gitignore | 1 + 6 files changed, 158 insertions(+), 1 deletion(-) create mode 100644 .config/yazi/init.lua create mode 100644 .config/yazi/package.toml create mode 100644 .config/yazi/yazi.toml diff --git a/.config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml b/.config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml index ba2bf6f..9caad2f 100644 --- a/.config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml +++ b/.config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml @@ -18,4 +18,5 @@ + diff --git a/.config/yazi/init.lua b/.config/yazi/init.lua new file mode 100644 index 0000000..629ca06 --- /dev/null +++ b/.config/yazi/init.lua @@ -0,0 +1,95 @@ +require("yatline"):setup({ + --theme = my_theme, + section_separator = { open = "", close = "" }, + part_separator = { open = "", close = "" }, + inverse_separator = { open = "", close = "" }, + style_a = { + fg = "black", + bg_mode = { + normal = "white", + select = "brightyellow", + un_set = "brightred", + }, + }, + style_b = { bg = "brightblack", fg = "brightwhite" }, + style_c = { bg = "black", fg = "brightwhite" }, + + permissions_t_fg = "green", + permissions_r_fg = "yellow", + permissions_w_fg = "red", + permissions_x_fg = "cyan", + permissions_s_fg = "white", + + tab_width = 20, + tab_use_inverse = false, + + selected = { icon = "󰻭", fg = "yellow" }, + copied = { icon = "", fg = "green" }, + cut = { icon = "", fg = "red" }, + + total = { icon = "󰮍", fg = "yellow" }, + succ = { icon = "", fg = "green" }, + fail = { icon = "", fg = "red" }, + found = { icon = "󰮕", fg = "blue" }, + processed = { icon = "󰐍", fg = "green" }, + + show_background = true, + + display_header_line = true, + display_status_line = true, + + component_positions = { "header", "tab", "status" }, + + header_line = { + left = { + section_a = { + { type = "line", custom = false, name = "tabs", params = { "left" } }, + }, + section_b = {}, + section_c = {}, + }, + right = { + section_a = { + { type = "string", custom = false, name = "date", params = { "%A, %d %B %Y" } }, + }, + section_b = { + { type = "string", custom = false, name = "date", params = { "%X" } }, + }, + section_c = {}, + }, + }, + + status_line = { + left = { + section_a = { + { type = "string", custom = false, name = "tab_mode" }, + }, + section_b = { + { type = "string", custom = false, name = "hovered_size" }, + }, + section_c = { + { type = "string", custom = false, name = "hovered_path" }, + { type = "coloreds", custom = false, name = "count" }, + }, + }, + right = { + section_a = { + { type = "string", custom = false, name = "cursor_position" }, + }, + section_b = { + { type = "string", custom = false, name = "cursor_percentage" }, + }, + section_c = { + { type = "string", custom = false, name = "hovered_file_extension", params = { true } }, + { type = "coloreds", custom = false, name = "permissions" }, + }, + }, + }, +}) + +require("fuse-archive"):setup({ + smart_enter = true, + mount_dir = "/tmp", +}) + +require("git"):setup() diff --git a/.config/yazi/keymap.toml b/.config/yazi/keymap.toml index d7bd4a1..79b2280 100644 --- a/.config/yazi/keymap.toml +++ b/.config/yazi/keymap.toml @@ -1,9 +1,19 @@ [manager] prepend_keymap = [ + { on = [ "", "m" ], run = "plugin mount", desc = "Displays mount dialog"}, + { on = [ "", 's'], run = "plugin what-size", desc = "Calc size of selection or cwd" }, + { on = [ "", ''], run = "plugin what-size --args='--clipboard'", desc = "Calc size of selection or cwd" }, + { on = ["", 'c'], desc = "Archive selected files", run = "plugin compress"}, + { on = ["", ""], desc = "Jump with zoxide", run = "plugin zoxide" }, + { on = "", desc = "Move to the tab on the left", run = "tab_switch 1 --relative" }, { on = "", desc = "Move to the tab on the right", run = "tab_switch -1 --relative" }, - { on = ["", 'z'], desc = "Zip the selected files", run = "shell '7z a .zip \"$@\"' --interactive --cursor=5"} + { on = ["c", 'm'], desc = "Change file mod", run = "plugin chmod"}, + + { on = [ "l" ], run = "plugin fuse-archive mount", desc = "Enter or Mount selected archive" }, + { on = [ "h" ], run = "plugin fuse-archive unmount", desc = "Leave or Unmount selected archive" }, ] append_keymap = [ { on = ['c', 'v'], desc = "Drag selected files", run = "shell 'blobdrop -b \"$@\"'" }, + { on = ['c', 'y'], desc = "Copy file/files to wl-clipboard", run = "plugin wl-clipboard"} ] diff --git a/.config/yazi/package.toml b/.config/yazi/package.toml new file mode 100644 index 0000000..86fc9d2 --- /dev/null +++ b/.config/yazi/package.toml @@ -0,0 +1,42 @@ +[[plugin.deps]] +use = "imsi32/yatline" +rev = "9328205" +hash = "3e51d1fd8a2e481fcfa8eab1251d1c5f" + +[[plugin.deps]] +use = "yazi-rs/plugins:mount" +rev = "5186af7" +hash = "5c4d8080367dd2561a18c1cf5a1dd295" + +[[plugin.deps]] +use = "pirafrank/what-size" +rev = "b23e3a4" +hash = "98e5f5af3efd3ba8bc2db0720187cc83" + +[[plugin.deps]] +use = "dawsers/fuse-archive" +rev = "a58327c" +hash = "6a6d24880ce7666048fb81ad758c48d3" + +[[plugin.deps]] +use = "KKV9/compress" +rev = "60b24af" +hash = "ee025be766240cc98e671754ac836da3" + +[[plugin.deps]] +use = "yazi-rs/plugins:git" +rev = "5186af7" +hash = "771f18427fb75fb19990ce602bb322f4" + +[[plugin.deps]] +use = "grappas/wl-clipboard" +rev = "c4edc4f" +hash = "51ff959c3c26cb3889589a0f8d394f14" + +[[plugin.deps]] +use = "yazi-rs/plugins:chmod" +rev = "5186af7" +hash = "f28138c2e11e87962b66d583fef724c3" + +[flavor] +deps = [] diff --git a/.config/yazi/yazi.toml b/.config/yazi/yazi.toml new file mode 100644 index 0000000..6c71328 --- /dev/null +++ b/.config/yazi/yazi.toml @@ -0,0 +1,8 @@ +[opener] +extract = [] + +[plugin] +prepend_fetchers = [ + { id = "git", name = "*", run = "git" }, + { id = "git", name = "*/", run = "git" } +] diff --git a/.gitignore b/.gitignore index 273cc83..eb83e49 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ .config/hypr/config/WorkspaceRules.conf .config/hypr/config/settings/Input.conf .config/waybar/Output.config.json +.config/evremap/evremap.toml