[pass] [PATCH 1/2] Split xclip stuff into its own function
Marc-Antoine Perennou
Marc-Antoine at perennou.com
Sat Feb 6 19:01:49 CET 2016
Hi,
Any news on these two patches? (As it seems patches are getting review
faster these days)Hi,
On 20 November 2015 at 22:26, Marc-Antoine Perennou
<Marc-Antoine at perennou.com> wrote:
> Signed-off-by: Marc-Antoine Perennou <Marc-Antoine at Perennou.com>
> ---
> src/password-store.sh | 11 ++++++++---
> 1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/src/password-store.sh b/src/password-store.sh
> index d535a74..06fb33f 100755
> --- a/src/password-store.sh
> +++ b/src/password-store.sh
> @@ -127,12 +127,12 @@ check_sneaky_paths() {
> # BEGIN platform definable
> #
>
> -clip() {
> +clip_xclip() {
> # 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 sleep_argv0="$1"
> + shift
> 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"
> (
> @@ -151,6 +151,11 @@ clip() {
>
> echo "$before" | base64 -d | xclip -selection "$X_SELECTION"
> ) 2>/dev/null & disown
> +}
> +clip() {
> + local sleep_argv0="password store sleep on display $DISPLAY"
> + pkill -f "^$sleep_argv0" 2>/dev/null && sleep 0.5
> + clip_xclip "$sleep_argv0" "$@"
> echo "Copied $2 to clipboard. Will clear in $CLIP_TIME seconds."
> }
> tmpdir() {
> --
> 2.6.3
>
More information about the Password-Store
mailing list