feat(fish-deps): add win32yank installer for WSL2
New optional-tier catalog entry, gated on WSL2 detection (/proc/sys/kernel/osrelease) so it never surfaces on a plain Linux box's install/sync prompts, only in the informational status listing. Downloads the x86_64 binary from GitHub releases to ~/.local/bin/win32yank.exe; fish-deps update refreshes an already-installed copy the same way.
This commit is contained in:
@@ -59,6 +59,7 @@ matter if you already use that specific tool. Skipped by
|
||||
| `screen` | GNU screen; fallback backend for `jobrunner` when `tmux` is unavailable. |
|
||||
| `marktext` | Markdown editor; backs the `md` wrapper, which is the only thing that references it. No distro packages it under a common name, so `fish-deps` offers the AUR package (`marktext-bin`) on Arch and otherwise installs upstream's AppImage to `~/.local/bin/marktext`. |
|
||||
| `firejail` | Sandbox; needed only by `md --read-only`, which uses it to make MarkText unable to save over the file it opened. Every other `md` invocation works without it. |
|
||||
| `win32yank.exe` | Clipboard bridge for WSL2; backs the `y`/`p`/`paste`/`hist` clipboard fallback chain when neither `wl-copy`/`wl-paste` nor `xclip` are present. `fish-deps` only offers to install it when WSL2 is detected (`microsoft` in `/proc/sys/kernel/osrelease`), downloading the x86_64 binary from GitHub releases to `~/.local/bin`. |
|
||||
|
||||
## Terminal Emulators
|
||||
|
||||
|
||||
@@ -36,27 +36,27 @@ function _fish_deps_catalog
|
||||
set -g _fdc_bins \
|
||||
uv cargo fish starship fzf zoxide direnv paru yay \
|
||||
wakatime tailscale \
|
||||
eza lsd bat btop dust duf prettyping go ov rg lazygit lazydocker docker trash kitty wezterm python3 yt-dlp screen mpv vlc marktext firejail
|
||||
eza lsd bat btop dust duf prettyping go ov rg lazygit lazydocker docker trash kitty wezterm python3 yt-dlp screen mpv vlc marktext firejail win32yank.exe
|
||||
|
||||
set -g _fdc_tiers \
|
||||
rec rec req rec req rec rec rec rec \
|
||||
int int \
|
||||
rec rec rec opt opt opt opt opt rec rec opt opt opt rec term term rec opt opt opt opt opt opt
|
||||
rec rec rec opt opt opt opt opt rec rec opt opt opt rec term term rec opt opt opt opt opt opt opt
|
||||
|
||||
set -g _fdc_cargo \
|
||||
"" "" "" starship "" zoxide "" "" "" \
|
||||
"" "" \
|
||||
eza lsd bat "" du-dust "" "" "" "" ripgrep "" "" "" trashy "" "" "" "" "" "" "" "" ""
|
||||
eza lsd bat "" du-dust "" "" "" "" ripgrep "" "" "" trashy "" "" "" "" "" "" "" "" "" ""
|
||||
|
||||
set -g _fdc_pm \
|
||||
uv cargo fish starship fzf zoxide direnv "" yay \
|
||||
wakatime tailscale \
|
||||
eza lsd bat btop dust duf prettyping go ov ripgrep lazygit lazydocker docker trash kitty wezterm python yt-dlp screen mpv vlc "" firejail
|
||||
eza lsd bat btop dust duf prettyping go ov ripgrep lazygit lazydocker docker trash kitty wezterm python yt-dlp screen mpv vlc "" firejail ""
|
||||
|
||||
set -g _fdc_special \
|
||||
curl-uv rustup-installer git-cargo-fish curl-installer fzf-update "" "" paru-build yay-build \
|
||||
wakatime-binary "" \
|
||||
"" "" "" "" "" "" "" "" go-ov "" "" curl-lazydocker "" "" "" "" "" "" "" "" "" marktext-release ""
|
||||
"" "" "" "" "" "" "" "" go-ov "" "" curl-lazydocker "" "" "" "" "" "" "" "" "" marktext-release "" win32yank-release
|
||||
end
|
||||
|
||||
# SYNOPSIS
|
||||
|
||||
@@ -46,6 +46,14 @@ function _fish_deps_install
|
||||
|
||||
set -l i 1
|
||||
for bin in $_fdc_bins
|
||||
# win32yank only matters under WSL2 — skip the entry entirely
|
||||
# elsewhere so a plain Linux box never sees it, not even as a
|
||||
# "no install method available" note.
|
||||
if test "$bin" = win32yank.exe; and not string match -qi '*microsoft*' (cat /proc/sys/kernel/osrelease 2>/dev/null)
|
||||
set i (math $i + 1)
|
||||
continue
|
||||
end
|
||||
|
||||
# Optional-tier deps are opt-in: skip unless --optional/--all was passed.
|
||||
if test "$_fdc_tiers[$i]" = opt; and test $include_optional -eq 0
|
||||
if not command -q $bin
|
||||
@@ -140,6 +148,15 @@ function _fish_deps_install
|
||||
end
|
||||
set -a methods special-marktext-appimage
|
||||
set -a method_labels "AppImage download (~/.local/bin/marktext)"
|
||||
case win32yank-release
|
||||
if test (uname -m) = x86_64
|
||||
set -a methods special-win32yank
|
||||
set -a method_labels "binary download (github releases)"
|
||||
else
|
||||
set_color brblack
|
||||
echo " note: win32yank only ships x86_64 builds (this is "(uname -m)")"
|
||||
set_color normal
|
||||
end
|
||||
case go-ov
|
||||
if type -q go
|
||||
set -a methods special-go-ov
|
||||
@@ -296,6 +313,18 @@ function _fish_deps_install
|
||||
and chmod +x "$_wt_bin"
|
||||
and ln -sf "$_wt_bin" "$HOME/.local/bin/wakatime"
|
||||
rm -rf "$_tmpdir"
|
||||
case special-win32yank
|
||||
set -l _zip win32yank-x64.zip
|
||||
set -l _tmpdir (mktemp -d)
|
||||
mkdir -p "$HOME/.local/bin"
|
||||
and curl -fL "https://github.com/equalsraf/win32yank/releases/latest/download/$_zip" \
|
||||
-o "$_tmpdir/$_zip"
|
||||
and unzip -o "$_tmpdir/$_zip" -d "$_tmpdir"
|
||||
and cp "$_tmpdir/win32yank.exe" "$HOME/.local/bin/win32yank.exe"
|
||||
and chmod +x "$HOME/.local/bin/win32yank.exe"
|
||||
set -l _dl_status $status
|
||||
rm -rf "$_tmpdir"
|
||||
test $_dl_status -eq 0
|
||||
case special-fzf
|
||||
fzf-update
|
||||
case special-curl
|
||||
|
||||
@@ -146,6 +146,25 @@ function _fish_deps_update
|
||||
continue
|
||||
end
|
||||
|
||||
# win32yank: re-download the binary from github releases (WSL2 only;
|
||||
# only reached if a copy is already on PATH, so no WSL check needed)
|
||||
if test "$special" = win32yank-release
|
||||
echo "Updating $bin..."
|
||||
set -l _zip win32yank-x64.zip
|
||||
set -l _tmpdir (mktemp -d)
|
||||
curl -fL "https://github.com/equalsraf/win32yank/releases/latest/download/$_zip" \
|
||||
-o "$_tmpdir/$_zip"
|
||||
and unzip -o "$_tmpdir/$_zip" -d "$_tmpdir"
|
||||
and cp "$_tmpdir/win32yank.exe" "$HOME/.local/bin/win32yank.exe"
|
||||
and chmod +x "$HOME/.local/bin/win32yank.exe"
|
||||
set -l _up_status $status
|
||||
rm -rf "$_tmpdir"
|
||||
test $_up_status -eq 0
|
||||
and set updated_any 1
|
||||
set i (math $i + 1)
|
||||
continue
|
||||
end
|
||||
|
||||
# pipx tools
|
||||
if test "$special" = pipx
|
||||
if type -q pipx
|
||||
|
||||
Reference in New Issue
Block a user