diff options
Diffstat (limited to 'src/platform')
-rw-r--r-- | src/platform/cygwin.sh | 8 | ||||
-rw-r--r-- | src/platform/darwin.sh | 9 | ||||
-rw-r--r-- | src/platform/freebsd.sh | 1 | ||||
-rw-r--r-- | src/platform/openbsd.sh | 1 |
4 files changed, 11 insertions, 8 deletions
diff --git a/src/platform/cygwin.sh b/src/platform/cygwin.sh index 737e367..5a8d5ea 100644 --- a/src/platform/cygwin.sh +++ b/src/platform/cygwin.sh @@ -4,13 +4,13 @@ clip() { local sleep_argv0="password store sleep on display $DISPLAY" pkill -f "^$sleep_argv0" 2>/dev/null && sleep 0.5 - local before="$(base64 < /dev/clipboard)" + local before="$($BASE64 < /dev/clipboard)" echo -n "$1" > /dev/clipboard ( ( exec -a "$sleep_argv0" sleep "$CLIP_TIME" ) - local now="$(base64 < /dev/clipboard)" - [[ $now != $(echo -n "$1" | base64) ]] && before="$now" - echo "$before" | base64 -d > /dev/clipboard + local now="$($BASE64 < /dev/clipboard)" + [[ $now != $(echo -n "$1" | $BASE64) ]] && before="$now" + echo "$before" | $BASE64 -d > /dev/clipboard ) >/dev/null 2>&1 & disown echo "Copied $2 to clipboard. Will clear in $CLIP_TIME seconds." } diff --git a/src/platform/darwin.sh b/src/platform/darwin.sh index a4f3515..342ecce 100644 --- a/src/platform/darwin.sh +++ b/src/platform/darwin.sh @@ -4,13 +4,13 @@ clip() { local sleep_argv0="password store sleep for user $(id -u)" pkill -f "^$sleep_argv0" 2>/dev/null && sleep 0.5 - local before="$(pbpaste | openssl base64)" + local before="$(pbpaste | $BASE64)" echo -n "$1" | pbcopy ( ( exec -a "$sleep_argv0" sleep "$CLIP_TIME" ) - local now="$(pbpaste | openssl base64)" - [[ $now != $(echo -n "$1" | openssl base64) ]] && before="$now" - echo "$before" | openssl base64 -d | pbcopy + local now="$(pbpaste | $BASE64)" + [[ $now != $(echo -n "$1" | $BASE64) ]] && before="$now" + echo "$before" | $BASE64 -d | pbcopy ) >/dev/null 2>&1 & disown echo "Copied $2 to clipboard. Will clear in $CLIP_TIME seconds." } @@ -45,3 +45,4 @@ qrcode() { GETOPT="$(brew --prefix gnu-getopt 2>/dev/null || { which port &>/dev/null && echo /opt/local; } || echo /usr/local)/bin/getopt" SHRED="srm -f -z" +BASE64="openssl base64" diff --git a/src/platform/freebsd.sh b/src/platform/freebsd.sh index d93c774..390bca2 100644 --- a/src/platform/freebsd.sh +++ b/src/platform/freebsd.sh @@ -3,3 +3,4 @@ GETOPT="/usr/local/bin/getopt" SHRED="rm -P -f" +BASE64="openssl base64" diff --git a/src/platform/openbsd.sh b/src/platform/openbsd.sh index b66b32f..fc27f6a 100644 --- a/src/platform/openbsd.sh +++ b/src/platform/openbsd.sh @@ -38,3 +38,4 @@ tmpdir() { GETOPT="gnugetopt" SHRED="rm -P -f" +BASE64="openssl base64" |