feat(profiles): add jwtf/phok-dev helpers, fix zoxide/zinit PATH ordering
- Add jwtf to cd into the repo root (with pass-through command support, same pattern as phok) - Add phok-dev alias forcing software H.264/H.265 decode and disabling DMA-BUF rendering, working around this laptop's Intel iHD VA-API driver corrupting hardware-decoded frames during Phokus dev builds - Move nvm/bun/PATH setup above zinit init so PATH is fully resolved before zoxide's hook and zinit's scheduler register - fixes intermittent "command not found: zoxide/sleep/true" errors - Drop zinit wait lucid turbo mode; its async scheduler was the source of the above errors - Rename up()'s local path var to target to avoid shadowing zsh's special path array
This commit is contained in:
+39
-29
@@ -33,6 +33,27 @@ _compinit_cached() {
|
||||
fi
|
||||
}
|
||||
|
||||
# ---------- nvm ----------
|
||||
export NVM_DIR="$HOME/.nvm"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
|
||||
[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion"
|
||||
|
||||
# ---------- bun ----------
|
||||
export BUN_INSTALL="$HOME/.bun"
|
||||
[ -s "$BUN_INSTALL/_bun" ] && source "$BUN_INSTALL/_bun"
|
||||
|
||||
# ---------- PATH ----------
|
||||
export PNPM_HOME="${PNPM_HOME:-$HOME/.local/share/pnpm}"
|
||||
export PATH="$HOME/.local/bin:$HOME/bin:/opt/homebrew/bin:$PATH"
|
||||
case ":$PATH:" in
|
||||
*":$PNPM_HOME/bin:"*) ;;
|
||||
*) export PATH="$PNPM_HOME/bin:$PATH" ;;
|
||||
esac
|
||||
case ":$PATH:" in
|
||||
*":$BUN_INSTALL/bin:"*) ;;
|
||||
*) export PATH="$BUN_INSTALL/bin:$PATH" ;;
|
||||
esac
|
||||
|
||||
# ---------- zinit (plugin manager, auto-install) ----------
|
||||
export ZINIT_HOME=${XDG_DATA_HOME:-$HOME/.local/share}/zinit/zinit.git
|
||||
if [[ ! -d $ZINIT_HOME ]]; then
|
||||
@@ -61,16 +82,14 @@ zstyle ':completion:*' menu select
|
||||
zstyle ':completion:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
|
||||
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
|
||||
|
||||
# ---------- plugins (deferred via turbo mode for faster startup) ----------
|
||||
# ---------- plugins ----------
|
||||
# fzf-tab needs compinit to have already run, and needs to load before
|
||||
# anything that wraps completion widgets (autosuggestions, syntax-highlighting).
|
||||
zinit ice wait lucid atinit'_compinit_cached'
|
||||
zinit ice atinit'_compinit_cached'
|
||||
zinit light Aloxaf/fzf-tab
|
||||
|
||||
zinit ice wait lucid
|
||||
zinit light zsh-users/zsh-autosuggestions
|
||||
|
||||
zinit ice wait lucid
|
||||
zinit light ajeetdsouza/zoxide
|
||||
eval "$(zoxide init zsh)"
|
||||
|
||||
@@ -84,11 +103,9 @@ else
|
||||
fi
|
||||
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
|
||||
export FZF_ALT_C_COMMAND="$FZF_DEFAULT_COMMAND"
|
||||
zinit ice wait lucid
|
||||
zinit light junegunn/fzf
|
||||
|
||||
# syntax-highlighting must be loaded last, after any plugin that wraps widgets
|
||||
zinit ice wait lucid
|
||||
zinit light zsh-users/zsh-syntax-highlighting
|
||||
|
||||
# ---------- aliases with smart fallbacks ----------
|
||||
@@ -115,14 +132,27 @@ phok() {
|
||||
fi
|
||||
}
|
||||
|
||||
jwtf() {
|
||||
cd "$HOME/Coding/jwtf" || return
|
||||
if [ "$#" -gt 0 ]; then
|
||||
"$@"
|
||||
fi
|
||||
}
|
||||
# This laptop's Intel iHD VA-API driver corrupts hardware-decoded video
|
||||
# frames (dmabuf allocator size-mismatch bug), and WebKitGTK's DMA-BUF
|
||||
# compositing path is separately broken on this GPU/driver combo too — force
|
||||
# software H.264/H.265 decode and disable DMA-BUF rendering for Phokus dev
|
||||
# builds so video playback is smooth.
|
||||
alias phok-dev='WEBKIT_DISABLE_DMABUF_RENDERER=1 GST_PLUGIN_FEATURE_RANK="vah264dec:0,vah265dec:0,vaapih264dec:0,vaapih265dec:0" pnpm --dir "$HOME/Coding/jwtf/apps/phokus" dev:app:cpu'
|
||||
|
||||
# ---------- misc helpers ----------
|
||||
mkcd(){ mkdir -p "$1" && cd "$1"; }
|
||||
up(){
|
||||
local n="${1:-1}"
|
||||
[[ "$n" =~ ^[0-9]+$ ]] || { echo "up: expects a number"; return 1; }
|
||||
local path=""
|
||||
for ((i=0; i<n; i++)); do path="../$path"; done
|
||||
cd "$path" || return
|
||||
local target=""
|
||||
for ((i=0; i<n; i++)); do target="../$target"; done
|
||||
cd "$target" || return
|
||||
}
|
||||
extract(){
|
||||
case "$1" in
|
||||
@@ -138,23 +168,3 @@ extract(){
|
||||
esac
|
||||
}
|
||||
|
||||
# ---------- nvm ----------
|
||||
export NVM_DIR="$HOME/.nvm"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
|
||||
[ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion"
|
||||
|
||||
# ---------- bun ----------
|
||||
export BUN_INSTALL="$HOME/.bun"
|
||||
[ -s "$BUN_INSTALL/_bun" ] && source "$BUN_INSTALL/_bun"
|
||||
|
||||
# ---------- PATH ----------
|
||||
export PNPM_HOME="${PNPM_HOME:-$HOME/.local/share/pnpm}"
|
||||
export PATH="$HOME/.local/bin:$HOME/bin:/opt/homebrew/bin:$PATH"
|
||||
case ":$PATH:" in
|
||||
*":$PNPM_HOME/bin:"*) ;;
|
||||
*) export PATH="$PNPM_HOME/bin:$PATH" ;;
|
||||
esac
|
||||
case ":$PATH:" in
|
||||
*":$BUN_INSTALL/bin:"*) ;;
|
||||
*) export PATH="$BUN_INSTALL/bin:$PATH" ;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user