~ubuntu-branches/debian/jessie/password-store/jessie

« back to all changes in this revision

Viewing changes to src/platform/darwin.sh

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2014-04-14 16:40:29 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20140414164029-lfkwiep2sltmsaic
Tags: 1.5-1
* New upstream release (closes: #744723).
  - Fix typos in "pass generate" documentation (closes: #739949).
* Go back to recommending xclip; pass now supports asking it to copy to
  the PRIMARY selection using PASSWORD_STORE_X_SELECTION=primary.
* Use dh_python2 to stop python-support generating
  /usr/share/python-support/pass.private.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2012 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
 
1
# Copyright (C) 2012 - 2014 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
2
2
# This file is licensed under the GPLv2+. Please see COPYING for more information.
3
3
 
4
4
clip() {
 
5
        sleep_argv0="password store sleep for user $(id -u)"
 
6
        pkill -f "^$sleep_argv0" 2>/dev/null && sleep 0.5
5
7
        before="$(pbpaste | openssl base64)"
6
8
        echo -n "$1" | pbcopy
7
9
        (
8
 
                sleep 45
 
10
                ( exec -a "$sleep_argv0" sleep "$CLIP_TIME" )
9
11
                now="$(pbpaste | openssl base64)"
10
 
                if [[ $now != $(echo -n "$1" | openssl base64) ]]; then
11
 
                        before="$now"
12
 
                fi
 
12
                [[ $now != $(echo -n "$1" | openssl base64) ]] && before="$now"
13
13
                echo "$before" | openssl base64 -d | pbcopy
14
 
        ) & disown
 
14
        ) 2>/dev/null & disown
15
15
        echo "Copied $2 to clipboard. Will clear in 45 seconds."
16
16
}
17
17
 
32
32
}
33
33
 
34
34
GETOPT="$(brew --prefix gnu-getopt 2>/dev/null || echo /usr/local)/bin/getopt"
 
35
SHRED="srm -f -z"