[pass] [PATCH] Added Parcellite clipboard manager support.

Andrew Todd at at auspicacious.org
Sun Feb 14 21:41:17 CET 2016


Since it looks like Jason has been monitoring more actively, I hope no-one
minds if I re-submit this simple patch from last year.

Parcellite is a standalone clipboard manager with a nice (if
underdocumented)
feature: it can be turned on and off through a fifo control. This patch
turns
off parcellite just before copying a password to the clipboard, and turns it
back on once the clipboard has been reset.

On Tue, Jul 21, 2015 at 10:03 PM, Andrew Todd <at at auspicacious.org> wrote:

> ---
>  src/password-store.sh | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/src/password-store.sh b/src/password-store.sh
> index d535a74..42708b7 100755
> --- a/src/password-store.sh
> +++ b/src/password-store.sh
> @@ -131,6 +131,11 @@ clip() {
>         # 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.
> +
> +       # If the parcellite clipboard manager is installed, disable it for
> +       # the duration. It will never record the password.
> +       echo -n "stop_all" >> "$HOME"/.local/share/parcellite/fifo_cmd
> +
>         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)"
> @@ -150,6 +155,10 @@ clip() {
>                 qdbus org.kde.klipper /klipper
> org.kde.klipper.klipper.clearClipboardHistory &>/dev/null
>
>                 echo "$before" | base64 -d | xclip -selection
> "$X_SELECTION"
> +
> +               # If the parcellite clipboard manager is installed,
> re-enable
> +               # it so it will continue recording normal history.
> +               echo -n "run_all" >>
> "$HOME"/.local/share/parcellite/fifo_cmd
>         ) 2>/dev/null & disown
>         echo "Copied $2 to clipboard. Will clear in $CLIP_TIME seconds."
>  }
> --
> 2.1.4
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20160214/29b3af4a/attachment.html>


More information about the Password-Store mailing list