diff options
-rw-r--r-- | .SRCINFO | 28 | ||||
-rw-r--r-- | PKGBUILD | 44 | ||||
-rw-r--r-- | clip-Add-support-for-wl-clipboard.patch | 110 |
3 files changed, 182 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..c5df51384e39 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,28 @@ +pkgbase = pass-wl-clipboard + pkgdesc = Stores, retrieves, generates, and synchronizes passwords securely (wl-clipboard support) + pkgver = 1.7.3 + pkgrel = 1 + url = https://www.passwordstore.org/ + arch = any + license = GPL2 + checkdepends = git + depends = xclip + depends = bash + depends = gnupg + depends = tree + depends = wl-clipboard + optdepends = git: for Git support + optdepends = dmenu: for passmenu + optdepends = qrencode: for QR code support + provides = passmenu + provides = pass + conflicts = passmenu + conflicts = pass + replaces = passmenu + source = https://git.zx2c4.com/password-store/snapshot/password-store-1.7.3.tar.xz + source = clip-Add-support-for-wl-clipboard.patch + sha256sums = 2b6c65846ebace9a15a118503dcd31b6440949a30d3b5291dfb5b1615b99a3f4 + sha256sums = 620ea56e441f7ba424e9eddb4bbbe67b120b7e0cffd42006fff2d28279169311 + +pkgname = pass-wl-clipboard + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..214180cf6ba3 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,44 @@ +# Maintainer: Ainola <ainola@archlinux.org> +# Maintainer: Lukas Fleischer <lfleischer@archlinux.org> +# Contributor: Simon Zimmermann <simon@insmo.com> + +pkgname=pass-wl-clipboard +pkgver=1.7.3 +pkgrel=1 +pkgdesc='Stores, retrieves, generates, and synchronizes passwords securely (wl-clipboard support)' +arch=('any') +url='https://www.passwordstore.org/' +license=('GPL2') +depends=('xclip' 'bash' 'gnupg' 'tree' 'wl-clipboard') +checkdepends=('git') +optdepends=('git: for Git support' + 'dmenu: for passmenu' + 'qrencode: for QR code support') +replaces=('passmenu') +provides=('passmenu' 'pass') +conflicts=('passmenu' 'pass') +source=( + "https://git.zx2c4.com/password-store/snapshot/password-store-${pkgver}.tar.xz" + "clip-Add-support-for-wl-clipboard.patch" +) +sha256sums=('2b6c65846ebace9a15a118503dcd31b6440949a30d3b5291dfb5b1615b99a3f4' + '620ea56e441f7ba424e9eddb4bbbe67b120b7e0cffd42006fff2d28279169311') + +prepare() { + cd "password-store-$pkgver" + # Until upstream accepts something like this + patch -p1 < ../clip-Add-support-for-wl-clipboard.patch +} + +check() { + cd "${srcdir}/password-store-$pkgver/" + make test +} + +package() { + cd "${srcdir}/password-store-$pkgver/" + make DESTDIR="${pkgdir}" WITH_ALLCOMP=yes install + + cd contrib/dmenu + install -Dm0755 passmenu "${pkgdir}/usr/bin/passmenu" +} diff --git a/clip-Add-support-for-wl-clipboard.patch b/clip-Add-support-for-wl-clipboard.patch new file mode 100644 index 000000000000..537332b63fde --- /dev/null +++ b/clip-Add-support-for-wl-clipboard.patch @@ -0,0 +1,110 @@ +From f327ed6650a333967bdc41754d0dfae8462433aa Mon Sep 17 00:00:00 2001 +From: Brett Cornwall <brett@i--b.com> +Date: Sun, 13 Jan 2019 18:56:50 -0700 +Subject: [PATCH] clip: Add support for wl-clipboard + +--- + README | 4 +++- + man/pass.1 | 7 ++++++- + src/password-store.sh | 24 +++++++++++++++++++----- + 3 files changed, 28 insertions(+), 7 deletions(-) + +diff --git a/README b/README +index 6b59965..1a46242 100644 +--- a/README ++++ b/README +@@ -19,8 +19,10 @@ Depends on: + http://www.gnupg.org/ + - git + http://www.git-scm.com/ +-- xclip ++- xclip (for X11 environments) + http://sourceforge.net/projects/xclip/ ++- wl-clipboard (for wlroots Wayland-based environments) ++ https://github.com/bugaevc/wl-clipboard + - tree >= 1.7.0 + http://mama.indstate.edu/users/ice/tree/ + - GNU getopt +diff --git a/man/pass.1 b/man/pass.1 +index 01a3fbe..bebb6a0 100644 +--- a/man/pass.1 ++++ b/man/pass.1 +@@ -99,6 +99,8 @@ Decrypt and print a password named \fIpass-name\fP. If \fI--clip\fP or \fI-c\fP + is specified, do not print the password but instead copy the first (or otherwise specified) + line to the clipboard using + .BR xclip (1) ++or ++.BR wl-clipboard(1) + and then restore the clipboard after 45 (or \fIPASSWORD_STORE_CLIP_TIME\fP) seconds. If \fI--qrcode\fP + or \fI-q\fP is specified, do not print the password but instead display a QR code using + .BR qrencode (1) +@@ -132,6 +134,8 @@ in generating passwords can be changed with the \fIPASSWORD_STORE_CHARACTER_SET\ + If \fI--clip\fP or \fI-c\fP is specified, do not print the password but instead copy + it to the clipboard using + .BR xclip (1) ++or ++.BR wl-clipboard(1) + and then restore the clipboard after 45 (or \fIPASSWORD_STORE_CLIP_TIME\fP) seconds. If \fI--qrcode\fP + or \fI-q\fP is specified, do not print the password but instead display a QR code using + .BR qrencode (1) +@@ -466,7 +470,8 @@ The location of the text editor used by \fBedit\fP. + .BR tr (1), + .BR git (1), + .BR xclip (1), +-.BR qrencode (1). ++.BR qrencode (1), ++.BR wl-clipboard (1). + + .SH AUTHOR + .B pass +diff --git a/src/password-store.sh b/src/password-store.sh +index d89d455..ebce17c 100755 +--- a/src/password-store.sh ++++ b/src/password-store.sh +@@ -152,16 +152,30 @@ check_sneaky_paths() { + # + + clip() { ++ # wl-clipboard's copy and paste is split into separate binaries. ++ if [[ -n $WAYLAND_DISPLAY ]] && type {wl-copy,wl-paste} &>/dev/null; then ++ local copy_cmd="wl-copy" ++ local paste_cmd="wl-paste -n" ++ if [[ $X_SELECTION == "primary" ]]; then ++ copy_cmd+=" --primary" ++ paste_cmd+=" --primary" ++ fi ++ local sleep_argv0="password store sleep on display $WAYLAND_DISPLAY" ++ else ++ local copy_cmd="${PASSWORD_STORE_copy_cmd:-xclip -selection "$X_SELECTION"}" ++ local paste_cmd="${PASSWORD_STORE_paste_cmd:-xclip -o -selection "$X_SELECTION"}" ++ local sleep_argv0="password store sleep on display $DISPLAY" ++ fi ++ + # This base64 business is because bash cannot store binary data in a shell + # variable. Specifically, it cannot store nulls nor (non-trivally) store + # trailing new lines. +- local sleep_argv0="password store sleep on display $DISPLAY" + pkill -f "^$sleep_argv0" 2>/dev/null && sleep 0.5 +- local before="$(xclip -o -selection "$X_SELECTION" 2>/dev/null | $BASE64)" +- echo -n "$1" | xclip -selection "$X_SELECTION" || die "Error: Could not copy data to the clipboard" ++ local before="$($paste_cmd 2>/dev/null | $BASE64)" ++ echo -n "$1" | $copy_cmd || die "Error: Could not copy data to the clipboard" + ( + ( exec -a "$sleep_argv0" bash <<<"trap 'kill %1' TERM; sleep '$CLIP_TIME' & wait" ) +- local now="$(xclip -o -selection "$X_SELECTION" | $BASE64)" ++ local now="$($paste_cmd | $BASE64)" + [[ $now != $(echo -n "$1" | $BASE64) ]] && before="$now" + + # It might be nice to programatically check to see if klipper exists, +@@ -173,7 +187,7 @@ clip() { + # so we axe it here: + qdbus org.kde.klipper /klipper org.kde.klipper.klipper.clearClipboardHistory &>/dev/null + +- echo "$before" | $BASE64 -d | xclip -selection "$X_SELECTION" ++ echo "$before" | $BASE64 -d | $copy_cmd + ) >/dev/null 2>&1 & disown + echo "Copied $2 to clipboard. Will clear in $CLIP_TIME seconds." + } +-- +2.20.1 + |