Imported from prdlk/dotfiles master (efdd827), which supersedes the omarchy branch (3031416). Drops the Umbriel, Noctalia, niri, CachyOS, macOS, and Blume docs-site layers; docs/ is plain Markdown.
12 lines
329 B
Bash
12 lines
329 B
Bash
# yazi wrapper: cd to the directory yazi was left in on exit.
|
|
yy() {
|
|
local tmp cwd
|
|
tmp=$(mktemp -t "yazi-cwd.XXXXXX")
|
|
command yazi "$@" --cwd-file="$tmp"
|
|
cwd=$(cat -- "$tmp" 2>/dev/null)
|
|
if [ -n "$cwd" ] && [ "$cwd" != "$PWD" ] && [ -d "$cwd" ]; then
|
|
builtin cd -- "$cwd"
|
|
fi
|
|
rm -f -- "$tmp"
|
|
}
|