feat(clipboard): fill the WSL2 clipboard gap with win32yank #161
@@ -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. |
|
| `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`. |
|
| `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. |
|
| `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
|
## Terminal Emulators
|
||||||
|
|
||||||
|
|||||||
@@ -36,27 +36,27 @@ function _fish_deps_catalog
|
|||||||
set -g _fdc_bins \
|
set -g _fdc_bins \
|
||||||
uv cargo fish starship fzf zoxide direnv paru yay \
|
uv cargo fish starship fzf zoxide direnv paru yay \
|
||||||
wakatime tailscale \
|
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 \
|
set -g _fdc_tiers \
|
||||||
rec rec req rec req rec rec rec rec \
|
rec rec req rec req rec rec rec rec \
|
||||||
int int \
|
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 \
|
set -g _fdc_cargo \
|
||||||
"" "" "" starship "" zoxide "" "" "" \
|
"" "" "" starship "" zoxide "" "" "" \
|
||||||
"" "" \
|
"" "" \
|
||||||
eza lsd bat "" du-dust "" "" "" "" ripgrep "" "" "" trashy "" "" "" "" "" "" "" "" ""
|
eza lsd bat "" du-dust "" "" "" "" ripgrep "" "" "" trashy "" "" "" "" "" "" "" "" "" ""
|
||||||
|
|
||||||
set -g _fdc_pm \
|
set -g _fdc_pm \
|
||||||
uv cargo fish starship fzf zoxide direnv "" yay \
|
uv cargo fish starship fzf zoxide direnv "" yay \
|
||||||
wakatime tailscale \
|
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 \
|
set -g _fdc_special \
|
||||||
curl-uv rustup-installer git-cargo-fish curl-installer fzf-update "" "" paru-build yay-build \
|
curl-uv rustup-installer git-cargo-fish curl-installer fzf-update "" "" paru-build yay-build \
|
||||||
wakatime-binary "" \
|
wakatime-binary "" \
|
||||||
"" "" "" "" "" "" "" "" go-ov "" "" curl-lazydocker "" "" "" "" "" "" "" "" "" marktext-release ""
|
"" "" "" "" "" "" "" "" go-ov "" "" curl-lazydocker "" "" "" "" "" "" "" "" "" marktext-release "" win32yank-release
|
||||||
end
|
end
|
||||||
|
|
||||||
# SYNOPSIS
|
# SYNOPSIS
|
||||||
|
|||||||
@@ -46,6 +46,14 @@ function _fish_deps_install
|
|||||||
|
|
||||||
set -l i 1
|
set -l i 1
|
||||||
for bin in $_fdc_bins
|
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.
|
# 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 test "$_fdc_tiers[$i]" = opt; and test $include_optional -eq 0
|
||||||
if not command -q $bin
|
if not command -q $bin
|
||||||
@@ -140,6 +148,15 @@ function _fish_deps_install
|
|||||||
end
|
end
|
||||||
set -a methods special-marktext-appimage
|
set -a methods special-marktext-appimage
|
||||||
set -a method_labels "AppImage download (~/.local/bin/marktext)"
|
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
|
case go-ov
|
||||||
if type -q go
|
if type -q go
|
||||||
set -a methods special-go-ov
|
set -a methods special-go-ov
|
||||||
@@ -296,6 +313,18 @@ function _fish_deps_install
|
|||||||
and chmod +x "$_wt_bin"
|
and chmod +x "$_wt_bin"
|
||||||
and ln -sf "$_wt_bin" "$HOME/.local/bin/wakatime"
|
and ln -sf "$_wt_bin" "$HOME/.local/bin/wakatime"
|
||||||
rm -rf "$_tmpdir"
|
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
|
case special-fzf
|
||||||
fzf-update
|
fzf-update
|
||||||
case special-curl
|
case special-curl
|
||||||
|
|||||||
@@ -146,6 +146,25 @@ function _fish_deps_update
|
|||||||
continue
|
continue
|
||||||
end
|
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
|
# pipx tools
|
||||||
if test "$special" = pipx
|
if test "$special" = pipx
|
||||||
if type -q pipx
|
if type -q pipx
|
||||||
|
|||||||
Reference in New Issue
Block a user