summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2012-09-19 16:56:17 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2012-09-19 16:56:17 +0200
commit14955bcb4f749f7a95ce8ac94d055cf3231f3696 (patch)
treeee40ef1f8341a9a0cf740fe156a1bc45df4c11f7 /src
parent35c74251ffcba187c2284d67b5bc425b057b0c18 (diff)
downloadpass-14955bcb4f749f7a95ce8ac94d055cf3231f3696.tar.gz
pass-14955bcb4f749f7a95ce8ac94d055cf3231f3696.tar.bz2
pass-14955bcb4f749f7a95ce8ac94d055cf3231f3696.zip
Make qdbus ugliness more segmented.
Diffstat (limited to '')
-rwxr-xr-xsrc/password-store.sh11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/password-store.sh b/src/password-store.sh
index b09c084..f0b965a 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -80,11 +80,16 @@ clip() {
if [[ $now != $(echo -n "$1" | base64) ]]; then
before="$now"
fi
+
# It might be nice to programatically check to see if klipper exists,
# as well as checking for other common clipboard managers. But for now,
- # this works fine. Clipboard managers frequently write their history
- # out in plaintext, so we axe it here.
- qdbus org.kde.klipper /klipper org.kde.klipper.klipper.clearClipboardHistory >/dev/null 2>&1
+ # this works fine -- if qdbus isn't there or if klipper isn't running,
+ # this essentially becomes a no-op.
+ #
+ # Clipboard managers frequently write their history out in plaintext,
+ # so we axe it here:
+ qdbus org.kde.klipper /klipper org.kde.klipper.klipper.clearClipboardHistory &>/dev/null
+
echo "$before" | base64 -d | xclip -selection clipboard
) & disown
echo "Copied $2 to clipboard. Will clear in 45 seconds."