summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-09-13 10:37:02 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-09-13 10:37:02 +0900
commitaf3ff7b4b2bee3530c16277cd0fe674b1687d353 (patch)
treee0813c568f6b251094b7cd7b79593538661dbf98
parentae5c5c58fdef7579ca9e0af69ca8dd4e851b563c (diff)
updates
-rw-r--r--ar/.config/shell/profile5
-rwxr-xr-xar/.local/bin/shortcuts40
-rw-r--r--mac/.config/shell/aliasrc3
-rw-r--r--mac/.config/shell/bm-dirs3
-rw-r--r--mac/.config/yazi/yazi-default.toml4
-rw-r--r--mac/.config/yazi/yazi.toml223
6 files changed, 43 insertions, 235 deletions
diff --git a/ar/.config/shell/profile b/ar/.config/shell/profile
index 69fab37..c62e454 100644
--- a/ar/.config/shell/profile
+++ b/ar/.config/shell/profile
@@ -18,6 +18,8 @@ unsetopt PROMPT_SP 2>/dev/null
export BROWSER=$(command -v librewolf || command -v firefox || command -v qutebrowser)
export EDITOR="nvim"
export EDITOR2="vim"
+# export FILE_MANAGER="lf $(lf -version)"
+export FILE_MANAGER="yazi $(yazi -version)"
export KEYTIMEOUT=10
export SUDO_EDITOR=$EDITOR
export SUDO_ASKPASS="$HOME/.local/bin/dmenupass"
@@ -115,9 +117,6 @@ export JUPYTER_PLATFORM_DIRS="1"
### --- KODI --- ###
export KODI_DATA="$XDG_DATA_HOME/kodi"
-### --- LF --- ###
-export FILE_MANAGER="lf $(lf -version)"
-
### --- LYNX --- ###
export LYNX_CFG="$HOME/.config/lynx/lynx.cfg"
export LYNX_LSS="$HOME/.config/lynx/lynx.lss"
diff --git a/ar/.local/bin/shortcuts b/ar/.local/bin/shortcuts
index 118becb..10e2e89 100755
--- a/ar/.local/bin/shortcuts
+++ b/ar/.local/bin/shortcuts
@@ -10,17 +10,19 @@ zsh_named_dirs="${XDG_CONFIG_HOME:-${HOME}/.config}/shell/zshnameddirrc"
lf_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/lf/shortcutrc"
vim_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/vim/shortcuts.vim"
nvim_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/nvim/shortcuts.lua"
+yazi_shortcuts="${XDG_CONFIG_HOME:-${HOME}/.config}/yazi/keymap.toml"
ranger_shortcuts="/dev/null"
qute_shortcuts="/dev/null"
fish_shortcuts="/dev/null"
vifm_shortcuts="/dev/null"
# Remove, prepare files
-rm -f "$lf_shortcuts" "$ranger_shortcuts" "$qute_shortcuts" "$zsh_named_dirs" "$vim_shortcuts" "$nvim_shortcuts" 2>/dev/null
+rm -f "$lf_shortcuts" "$ranger_shortcuts" "$qute_shortcuts" "$zsh_named_dirs" "$vim_shortcuts" "$nvim_shortcuts" "$yazi_shortcuts" 2>/dev/null
printf "# vim: filetype=sh\\n" >"$fish_shortcuts"
printf "# vim: filetype=sh\\nalias " >"$shell_shortcuts"
printf "# vim: filetype=sh\\n" >"$shell_env_shortcuts"
printf "\" vim: filetype=vim\\n" >"$vifm_shortcuts"
+cp "$HOME/.config/yazi/keymap-default.toml" "$yazi_shortcuts"
# Format the `directories` file in the correct syntax and sent it to all three configs.
eval "echo \"$(cat "$bmdirs")\"" |
@@ -35,9 +37,13 @@ eval "echo \"$(cat "$bmdirs")\"" |
printf(\"map %s cd \42%s\42 \n\",\$1,\$2) >> \"$lf_shortcuts\" ;
printf(\"cmap ;%s %s\n\",\$1,\$2) >> \"$vim_shortcuts\" ;
printf(\"nmap <localleader><localleader>%s :Explore %s<cr>\n\",\$1,\$2) >> \"$vim_shortcuts\" ;
- printf(\"vim.keymap.set('c', ';%s', '%s<cr>', { noremap = true, silent = true, desc = '%s' })\n\", \$1, \$2, gensub(\"^/home/$USER/\",\"~/\",\"g\",\$2)) >> \"$nvim_shortcuts\" ;
- printf(\"vim.keymap.set('n', '<localleader><leader>%s', '<cmd>Explore %s<cr>', { noremap = true, silent = true, desc = '%s' })\n\", \$1, \$2, gensub(\"^/home/$USER/\",\"~/\",\"g\",\$2)) >> \"$nvim_shortcuts\" ;
- printf(\"vim.keymap.set('n', '<localleader><localleader>%s', function() require('mini.files').open('%s') end, { noremap = true, silent = true, desc = '%s' })\n\", \$1, \$2, gensub(\"^/home/$USER/\",\"~/\",\"g\",\$2)) >> \"$nvim_shortcuts\"}"
+ desc_path = \$2; gsub(\"^/home/$USER/\",\"~/\",desc_path);
+ printf(\"vim.keymap.set('c', ';%s', '%s<cr>', { noremap = true, silent = true, desc = '%s' })\n\", \$1, \$2, desc_path) >> \"$nvim_shortcuts\" ;
+ printf(\"vim.keymap.set('n', '<localleader><leader>%s', '<cmd>Explore %s<cr>', { noremap = true, silent = true, desc = '%s' })\n\", \$1, \$2, desc_path) >> \"$nvim_shortcuts\" ;
+ printf(\"vim.keymap.set('n', '<localleader><localleader>%s', function() require('mini.files').open('%s') end, { noremap = true, silent = true, desc = '%s' })\n\", \$1, \$2, desc_path) >> \"$nvim_shortcuts\" ;
+ desc_path = \$2; gsub(\"^/home/$USER/\",\"~/\",desc_path);
+ key_array = \"\\\"\\\\\\\\\\\"\"; for(i=1; i<=length(\$1); i++) { key_array = key_array \", \\\"\" substr(\$1,i,1) \"\\\"\" }
+ printf(\"\\t{ on = [ %s ], run = \\\"cd %s\\\", desc = \\\"Go to %s\\\" },\\n\",key_array,\$2,desc_path) >> \"$yazi_shortcuts.tmp\"}"
# Format the `files` file in the correct syntax and sent it to both configs.
eval "echo \"$(cat "$bmfiles")\"" |
@@ -55,8 +61,30 @@ eval "echo \"$(cat "$bmfiles")\"" |
printf(\"map v%s \$\$EDITOR2 \42%s\42 \n\",\$1,\$2) >> \"$lf_shortcuts\" ;
printf(\"cmap ;%s %s\n\",\$1,\$2) >> \"$vim_shortcuts\" ;
printf(\"nmap <localleader><localleader>%s :e %s<cr>\n\",\$1,\$2) >> \"$vim_shortcuts\" ;
- printf(\"vim.keymap.set('c', ';%s', '%s<cr>', { noremap = true, silent = true, desc = '%s' })\n\", \$1, \$2, gensub(\"^/home/$USER/\",\"~/\",\"g\",\$2)) >> \"$nvim_shortcuts\" ;
- printf(\"vim.keymap.set('n', '<localleader><localleader>%s', '<cmd>e %s<cr>', { noremap = true, silent = true, desc = '%s' })\n\", \$1, \$2, gensub(\"^/home/$USER/\",\"~/\",\"g\",\$2)) >> \"$nvim_shortcuts\"}"
+ desc_path = \$2; gsub(\"^/home/$USER/\",\"~/\",desc_path);
+ printf(\"vim.keymap.set('c', ';%s', '%s<cr>', { noremap = true, silent = true, desc = '%s' })\n\", \$1, \$2, desc_path) >> \"$nvim_shortcuts\" ;
+ printf(\"vim.keymap.set('n', '<localleader><localleader>%s', '<cmd>e %s<cr>', { noremap = true, silent = true, desc = '%s' })\n\", \$1, \$2, desc_path) >> \"$nvim_shortcuts\" ;
+ desc_path = \$2; gsub(\"^/home/$USER/\",\"~/\",desc_path);
+ key_array = \"\\\"\\\\\\\\\\\"\"; for(i=1; i<=length(\$1); i++) { key_array = key_array \", \\\"\" substr(\$1,i,1) \"\\\"\" }
+ printf(\"\\t{ on = [ %s ], run = \\\"open %s\\\", desc = \\\"Open %s\\\" },\\n\",key_array,\$2,desc_path) >> \"$yazi_shortcuts.tmp\"}"
+
+# Merge bookmarks into keymap-default.toml
+if [ -f "$yazi_shortcuts.tmp" ]; then
+ # Find the line with the closing bracket in the [mgr] section
+ line_num=$(grep -n "^]" "$yazi_shortcuts" | head -1 | cut -d: -f1)
+
+ # Create the merged file
+ head -n $((line_num - 1)) "$yazi_shortcuts" >"$yazi_shortcuts.new"
+ echo "" >>"$yazi_shortcuts.new"
+ echo " # Custom bookmarks" >>"$yazi_shortcuts.new"
+ cat "$yazi_shortcuts.tmp" >>"$yazi_shortcuts.new"
+ echo "]" >>"$yazi_shortcuts.new"
+ tail -n +$((line_num + 1)) "$yazi_shortcuts" >>"$yazi_shortcuts.new"
+
+ # Replace the original file
+ mv "$yazi_shortcuts.new" "$yazi_shortcuts"
+ rm -f "$yazi_shortcuts.tmp"
+fi
# root
root_shell_shortcuts="/root/.config/shell/rootshortcutrc"
diff --git a/mac/.config/shell/aliasrc b/mac/.config/shell/aliasrc
index 979c754..46e2eb1 100644
--- a/mac/.config/shell/aliasrc
+++ b/mac/.config/shell/aliasrc
@@ -484,6 +484,9 @@ alias xauto='xrandr --auto'
# xset
alias xoff='xset s off -dpms'
+# yazi
+alias y='yazi'
+
# zathura
alias za='zathura'
diff --git a/mac/.config/shell/bm-dirs b/mac/.config/shell/bm-dirs
index c27eb87..0d1f334 100644
--- a/mac/.config/shell/bm-dirs
+++ b/mac/.config/shell/bm-dirs
@@ -42,7 +42,8 @@ cvc ${XDG_CONFIG_HOME:-${HOME}/.config}/vim
cvp ${XDG_CONFIG_HOME:-${HOME}/.config}/openvpn
cvw ${XDG_DATA_HOME:-${HOME}/.local/share}/vimwiki
cxc ${XDG_CONFIG_HOME:-${HOME}/.config}/x11
-cya ${XDG_CONFIG_HOME:-${HOME}/.config}/yazi
+cyb ${XDG_CONFIG_HOME:-${HOME}/.config}/yabai
+cyz ${XDG_CONFIG_HOME:-${HOME}/.config}/yazi
czc ${XDG_CONFIG_HOME:-${HOME}/.config}/zsh
dot ${XDG_DOTFILES_DIR:-${HOME}/.dotfiles}
Esm /etc/samba
diff --git a/mac/.config/yazi/yazi-default.toml b/mac/.config/yazi/yazi-default.toml
index 9a7e24c..767ce53 100644
--- a/mac/.config/yazi/yazi-default.toml
+++ b/mac/.config/yazi/yazi-default.toml
@@ -19,8 +19,8 @@ title_format = "Yazi: {cwd}"
[preview]
wrap = "no"
tab_size = 2
-max_width = 600
-max_height = 900
+max_width = 800
+max_height = 1200
cache_dir = ""
image_delay = 30
image_filter = "triangle"
diff --git a/mac/.config/yazi/yazi.toml b/mac/.config/yazi/yazi.toml
deleted file mode 100644
index 9a7e24c..0000000
--- a/mac/.config/yazi/yazi.toml
+++ /dev/null
@@ -1,223 +0,0 @@
-# A TOML linter such as https://taplo.tamasfe.dev/ can use this schema to validate your config.
-# If you encounter any issues, please make an issue at https://github.com/yazi-rs/schemas.
-"$schema" = "https://yazi-rs.github.io/schemas/yazi.json"
-
-[mgr]
-ratio = [ 1, 4, 3 ]
-sort_by = "alphabetical"
-sort_sensitive = false
-sort_reverse = false
-sort_dir_first = true
-sort_translit = false
-linemode = "none"
-show_hidden = false
-show_symlink = true
-scrolloff = 5
-mouse_events = [ "click", "scroll" ]
-title_format = "Yazi: {cwd}"
-
-[preview]
-wrap = "no"
-tab_size = 2
-max_width = 600
-max_height = 900
-cache_dir = ""
-image_delay = 30
-image_filter = "triangle"
-image_quality = 75
-ueberzug_scale = 1
-ueberzug_offset = [ 0, 0, 0, 0 ]
-
-[opener]
-edit = [
- { run = '${EDITOR:-vi} "$@"', desc = "$EDITOR", block = true, for = "unix" },
- { run = 'code %*', orphan = true, desc = "code", for = "windows" },
- { run = 'code -w %*', block = true, desc = "code (block)", for = "windows" },
-]
-open = [
- { run = 'xdg-open "$1"', desc = "Open", for = "linux" },
- { run = 'open "$@"', desc = "Open", for = "macos" },
- { run = 'start "" "%1"', orphan = true, desc = "Open", for = "windows" },
- { run = 'termux-open "$1"', desc = "Open", for = "android" },
-]
-reveal = [
- { run = 'xdg-open "$(dirname "$1")"', desc = "Reveal", for = "linux" },
- { run = 'open -R "$1"', desc = "Reveal", for = "macos" },
- { run = 'explorer /select,"%1"', orphan = true, desc = "Reveal", for = "windows" },
- { run = 'termux-open "$(dirname "$1")"', desc = "Reveal", for = "android" },
- { run = '''clear; exiftool "$1"; echo "Press enter to exit"; read _''', block = true, desc = "Show EXIF", for = "unix" },
-]
-extract = [
- { run = 'ya pub extract --list "$@"', desc = "Extract here", for = "unix" },
- { run = 'ya pub extract --list %*', desc = "Extract here", for = "windows" },
-]
-play = [
- { run = 'mpv --force-window "$@"', orphan = true, for = "unix" },
- { run = 'mpv --force-window %*', orphan = true, for = "windows" },
- { run = '''mediainfo "$1"; echo "Press enter to exit"; read _''', block = true, desc = "Show media info", for = "unix" },
-]
-
-[open]
-rules = [
- # Folder
- { name = "*/", use = [ "edit", "open", "reveal" ] },
- # Text
- { mime = "text/*", use = [ "edit", "reveal" ] },
- # Image
- { mime = "image/*", use = [ "open", "reveal" ] },
- # Media
- { mime = "{audio,video}/*", use = [ "play", "reveal" ] },
- # Archive
- { mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", use = [ "extract", "reveal" ] },
- # JSON
- { mime = "application/{json,ndjson}", use = [ "edit", "reveal" ] },
- { mime = "*/javascript", use = [ "edit", "reveal" ] },
- # Empty file
- { mime = "inode/empty", use = [ "edit", "reveal" ] },
- # Fallback
- { name = "*", use = [ "open", "reveal" ] },
-]
-
-[tasks]
-micro_workers = 10
-macro_workers = 10
-bizarre_retry = 3
-image_alloc = 536870912 # 512MB
-image_bound = [ 5000, 5000 ]
-suppress_preload = false
-
-[plugin]
-fetchers = [
- # Mimetype
- { id = "mime", name = "*", run = "mime", prio = "high" },
-]
-spotters = [
- { name = "*/", run = "folder" },
- # Code
- { mime = "text/*", run = "code" },
- { mime = "application/{mbox,javascript,wine-extension-ini}", run = "code" },
- # Image
- { mime = "image/{avif,hei?,jxl}", run = "magick" },
- { mime = "image/svg+xml", run = "svg" },
- { mime = "image/*", run = "image" },
- # Video
- { mime = "video/*", run = "video" },
- # Fallback
- { name = "*", run = "file" },
-]
-preloaders = [
- # Image
- { mime = "image/{avif,hei?,jxl}", run = "magick" },
- { mime = "image/svg+xml", run = "svg" },
- { mime = "image/*", run = "image" },
- # Video
- { mime = "video/*", run = "video" },
- # PDF
- { mime = "application/pdf", run = "pdf" },
- # Font
- { mime = "font/*", run = "font" },
- { mime = "application/ms-opentype", run = "font" },
-]
-previewers = [
- { name = "*/", run = "folder" },
- # Code
- { mime = "text/*", run = "code" },
- { mime = "application/{mbox,javascript,wine-extension-ini}", run = "code" },
- # JSON
- { mime = "application/{json,ndjson}", run = "json" },
- # Image
- { mime = "image/{avif,hei?,jxl}", run = "magick" },
- { mime = "image/svg+xml", run = "svg" },
- { mime = "image/*", run = "image" },
- # Video
- { mime = "video/*", run = "video" },
- # PDF
- { mime = "application/pdf", run = "pdf" },
- # Archive
- { mime = "application/{zip,rar,7z*,tar,gzip,xz,zstd,bzip*,lzma,compress,archive,cpio,arj,xar,ms-cab*}", run = "archive" },
- { mime = "application/{debian*-package,redhat-package-manager,rpm,android.package-archive}", run = "archive" },
- { name = "*.{AppImage,appimage}", run = "archive" },
- # Virtual Disk / Disk Image
- { mime = "application/{iso9660-image,qemu-disk,ms-wim,apple-diskimage}", run = "archive" },
- { mime = "application/virtualbox-{vhd,vhdx}", run = "archive" },
- { name = "*.{img,fat,ext,ext2,ext3,ext4,squashfs,ntfs,hfs,hfsx}", run = "archive" },
- # Font
- { mime = "font/*", run = "font" },
- { mime = "application/ms-opentype", run = "font" },
- # Empty file
- { mime = "inode/empty", run = "empty" },
- # Fallback
- { name = "*", run = "file" },
-]
-
-[input]
-cursor_blink = false
-
-# cd
-cd_title = "Change directory:"
-cd_origin = "top-center"
-cd_offset = [ 0, 2, 50, 3 ]
-
-# create
-create_title = [ "Create:", "Create (dir):" ]
-create_origin = "top-center"
-create_offset = [ 0, 2, 50, 3 ]
-
-# rename
-rename_title = "Rename:"
-rename_origin = "hovered"
-rename_offset = [ 0, 1, 50, 3 ]
-
-# filter
-filter_title = "Filter:"
-filter_origin = "top-center"
-filter_offset = [ 0, 2, 50, 3 ]
-
-# find
-find_title = [ "Find next:", "Find previous:" ]
-find_origin = "top-center"
-find_offset = [ 0, 2, 50, 3 ]
-
-# search
-search_title = "Search via {n}:"
-search_origin = "top-center"
-search_offset = [ 0, 2, 50, 3 ]
-
-# shell
-shell_title = [ "Shell:", "Shell (block):" ]
-shell_origin = "top-center"
-shell_offset = [ 0, 2, 50, 3 ]
-
-[confirm]
-# trash
-trash_title = "Trash {n} selected file{s}?"
-trash_origin = "center"
-trash_offset = [ 0, 0, 70, 20 ]
-
-# delete
-delete_title = "Permanently delete {n} selected file{s}?"
-delete_origin = "center"
-delete_offset = [ 0, 0, 70, 20 ]
-
-# overwrite
-overwrite_title = "Overwrite file?"
-overwrite_content = "Will overwrite the following file:"
-overwrite_origin = "center"
-overwrite_offset = [ 0, 0, 50, 15 ]
-
-# quit
-quit_title = "Quit?"
-quit_content = "The following tasks are still running, are you sure you want to quit?"
-quit_origin = "center"
-quit_offset = [ 0, 0, 50, 15 ]
-
-[pick]
-open_title = "Open with:"
-open_origin = "hovered"
-open_offset = [ 0, 1, 50, 7 ]
-
-[which]
-sort_by = "none"
-sort_sensitive = false
-sort_reverse = false
-sort_translit = false