1
Fork 0

wsl: add wsl-clipboard script

This commit is contained in:
Alan Faubert 2024-12-17 20:48:21 -05:00
parent 465693b3f0
commit fce4d3dd6a
2 changed files with 5 additions and 0 deletions

View file

@ -8,6 +8,7 @@ Use [`install.cmd`](install.cmd) to set up a new WSL installation. Run without a
- [`wsl-apt`](scripts/wsl-apt) - run `apt update`/`upgrade`/`install`/`remove`/`autoremove`/`autoclean`
- any package names given as arguments are treated as packages to `install`, except any prefixed with a `-` are treated as packages to `remove`
- [`wsl-clipboard`](scripts/wsl-clipboard) - pipe stdin/stdout to set/read Windows clipboard
- [`wsl-expose-filesystem`](scripts/wsl-expose-filesystem) - expose entire filesystem to all WSL instances at `/mnt/wsl/$WSL_DISTRO_NAME`
- [`wsl-expose-ports`](scripts/wsl-expose-ports) - expose one or more ports within WSL to the outside world
- this sets up a port proxy and a Windows firewall rule for each exposed port, and removes previous port proxies and firewall rules

4
wsl/scripts/wsl-clipboard Executable file
View file

@ -0,0 +1,4 @@
#!/bin/sh
[ -t 0 ] && [ -t 1 ] && { >&2 echo Must pipe stdin/stdout to set/read Windows clipboard.; exit 1; }
[ -t 0 ] || clip.exe
[ -t 1 ] || powershell.exe -noprofile -command get-clipboard | tr --delete \\r