Files
omarchy/dot_config/bash/functions/yy.bash
T
Prad Nukala b18729f4a0 Initial import: chezmoi source for Omarchy (Hyprland)
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.
2026-11-02 09:14:11 -05:00

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"
}