Skip to content

feat: provision yazi (TUI file manager) with previews - #3

Open
Chikimuras wants to merge 2 commits into
mainfrom
feat/yazi
Open

Chikimuras wants to merge 2 commits into
mainfrom
feat/yazi

Conversation

@Chikimuras

Copy link
Copy Markdown
Owner

Porte le setup yazi du Mac vers le provisioning Ubuntu, pour que les deux machines aient le même gestionnaire de fichiers.

Ce que ça ajoute

  • install/10-packages.sh — section 9 : yazi + ya depuis le zip upstream. Yazi n'est pas packagé sur Ubuntu 24.04, donc même schéma que jira-cli (download → install -m 0755 dans ~/.local/bin). Les binaires sont localisés avec find, ce qui rend le script insensible à la structure interne de l'archive.
  • Deps de preview dans la liste apt : ffmpeg (vidéo), poppler-utils (PDF), imagemagick (raster), unzip (pour dépaqueter la release elle-même).
  • dotfiles/yazi/ — nouveau package stow. Config partagée entre macOS et Ubuntu : les openers sont splittés avec for = "macos" / for = "linux" plutôt que forkés en deux fichiers, donc il n'y a qu'une config à maintenir.
  • dotfiles/zsh/.zsh/functions/40-yazi.zsh — la fonction y.
  • dotfiles/tmux/allow-passthrough on.
  • .github/workflows/ci.yml — le check de conflits stow couvre le nouveau package.

Deux détails qui ne sont pas du cosmétique

allow-passthrough on dans tmux. Les previews d'images de yazi passent par le protocole graphique kitty. Sans cette option, tmux avale les séquences et les previews ne s'affichent jamais — silencieusement, sans le moindre message d'erreur.

command rm dans la fonction y. Zsh expanse les alias à la définition d'une fonction, pas à son appel. Avec alias rm=trash dans la config, un rm nu se retrouve figé en trash dans le corps stocké, et chaque invocation de y enverrait son fichier temporaire --cwd-file à la corbeille. Vérifiable avec whence -f y.

Vérifications

Fait en local (macOS) :

  • shellcheck -S warning -x via la commande exacte de la CI → 0 problème
  • ci.yml parse
  • la config se charge sous yazi 26.9.1 (stderr vide sur un vrai pty)
  • y fait bien le cd en sortie

Pas vérifiable en local : les chemins Ubuntu — apt, le téléchargement de la release, le stow (stow n'est pas installé sur le Mac). C'est cette CI qui les exerce pour la première fois.

🤖 Generated with Claude Code

Chikimuras and others added 2 commits September 18, 2026 09:24
Ports the macOS setup to the Ubuntu provisioning so both machines get the
same file manager:

- install yazi + ya from the upstream release zip (not packaged for 24.04),
  following the jira-cli pattern: download, locate the binaries with find so
  the archive's internal layout doesn't matter, install into ~/.local/bin
- add the preview dependencies to the apt list: ffmpeg (video), poppler-utils
  (PDF), imagemagick (raster), unzip (to unpack the release itself)
- new `yazi` stow package holding a config shared by both OSes; the openers
  are split with `for = "macos"` / `for = "linux"` rather than forked into
  two files, so there is a single config to keep in sync
- new `y` shell function: yazi cannot change its parent shell's cwd, so it
  writes the last directory to --cwd-file and the wrapper cds there. It calls
  `command rm`, because a bare `rm` is aliased to `trash` in this config and
  zsh expands aliases when a function is *defined*, which would send every
  temp cwd file to the trash
- tmux: allow-passthrough on, without which the kitty graphics protocol is
  swallowed by tmux and image previews silently never render
- cover the new stow package in the CI conflict check

Verified locally on macOS: shellcheck clean (the exact CI command), config
parses under yazi 26.9.1, `y` cds correctly. The Ubuntu paths (apt, the
release download, stow) are only exercised by CI.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Under --dry-run, run() only prints, so nothing is downloaded or unzipped and
the find over the temp dir is legitimately empty. The diagnostic fired anyway
and every dry-run logged two warnings that looked like an upstream layout
change. Keep the warning for real runs, where it is the useful signal.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant