[prev in list] [next in list] [prev in thread] [next in thread]
List: password-store
Subject: Re: [PATCH] Add support for Windows clipboard (WSL)
From: Douglas Silva <doug.hs () proton ! me>
Date: 2023-05-14 6:05:58
Message-ID: 9GHs7xPnGVutXHBRn3T2KGS5K2BWHYsOkjLh8OY8koDlVwp8P3gPeCTrad1AUo0BBhOvo963ltt8fpP9S4DWt3Rdw7B4_Co6Eq6C53yrNRk= () proton ! me
[Download RAW message or body]
Windows 11 is now exposing your display to WSL. This means xclip and wl-clipboard \
will no longer fail with an error.
pass will attempt to use wl-clipboard, because the variable $WAYLAND_DISPLAY is now \
set ("wayland-0").
This Wayland display mirrors your host [Windows] display. I've tested it and the clip \
function works, including the cleanup after 45 seconds.
------- Original Message -------
Em sábado, 15 de outubro de 2022 às 8:59 PM, Douglas Silva <doug.hs@proton.me> \
escreveu:
> This makes the -c (copy to clipboard) option work on WSL, by using the clip.exe \
> command if it's available. I picked $WSL_DISTRO_NAME to test for it.
> Note that I didn't set "paste_cmd" or "display_name". I couldn't find any paste \
> command for Windows, and I don't understand what they're used for.
> ---
> src/password-store.sh | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/password-store.sh b/src/password-store.sh
> index 22e818f..7f64b68 100755
> --- a/src/password-store.sh
> +++ b/src/password-store.sh
> @@ -155,7 +155,9 @@ check_sneaky_paths() {
> #
>
> clip() {
> - if [[ -n $WAYLAND_DISPLAY ]] && command -v wl-copy &> /dev/null; then
>
> + if [[ -n $WSL_DISTRO_NAME ]] && command -v clip.exe &> /dev/null; then
>
> + local copy_cmd=( clip.exe )
> + elif [[ -n $WAYLAND_DISPLAY ]] && command -v wl-copy &> /dev/null; then
>
> local copy_cmd=( wl-copy )
> local paste_cmd=( wl-paste -n )
> if [[ $X_SELECTION == primary ]]; then
> --
> 2.34.1
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic