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:
2026-07-26 07:12:36 +01:00
parent ee503a225c
commit ef24dbc4e5
+39 -29
View File
@@ -33,6 +33,27 @@ _compinit_cached() {
fi 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) ---------- # ---------- zinit (plugin manager, auto-install) ----------
export ZINIT_HOME=${XDG_DATA_HOME:-$HOME/.local/share}/zinit/zinit.git export ZINIT_HOME=${XDG_DATA_HOME:-$HOME/.local/share}/zinit/zinit.git
if [[ ! -d $ZINIT_HOME ]]; then 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:*' matcher-list '' 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} 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 # fzf-tab needs compinit to have already run, and needs to load before
# anything that wraps completion widgets (autosuggestions, syntax-highlighting). # 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 light Aloxaf/fzf-tab
zinit ice wait lucid
zinit light zsh-users/zsh-autosuggestions zinit light zsh-users/zsh-autosuggestions
zinit ice wait lucid
zinit light ajeetdsouza/zoxide zinit light ajeetdsouza/zoxide
eval "$(zoxide init zsh)" eval "$(zoxide init zsh)"
@@ -84,11 +103,9 @@ else
fi fi
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND" export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_ALT_C_COMMAND="$FZF_DEFAULT_COMMAND" export FZF_ALT_C_COMMAND="$FZF_DEFAULT_COMMAND"
zinit ice wait lucid
zinit light junegunn/fzf zinit light junegunn/fzf
# syntax-highlighting must be loaded last, after any plugin that wraps widgets # syntax-highlighting must be loaded last, after any plugin that wraps widgets
zinit ice wait lucid
zinit light zsh-users/zsh-syntax-highlighting zinit light zsh-users/zsh-syntax-highlighting
# ---------- aliases with smart fallbacks ---------- # ---------- aliases with smart fallbacks ----------
@@ -115,14 +132,27 @@ phok() {
fi 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 ---------- # ---------- misc helpers ----------
mkcd(){ mkdir -p "$1" && cd "$1"; } mkcd(){ mkdir -p "$1" && cd "$1"; }
up(){ up(){
local n="${1:-1}" local n="${1:-1}"
[[ "$n" =~ ^[0-9]+$ ]] || { echo "up: expects a number"; return 1; } [[ "$n" =~ ^[0-9]+$ ]] || { echo "up: expects a number"; return 1; }
local path="" local target=""
for ((i=0; i<n; i++)); do path="../$path"; done for ((i=0; i<n; i++)); do target="../$target"; done
cd "$path" || return cd "$target" || return
} }
extract(){ extract(){
case "$1" in case "$1" in
@@ -138,23 +168,3 @@ extract(){
esac 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