From 14955bcb4f749f7a95ce8ac94d055cf3231f3696 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 19 Sep 2012 16:56:17 +0200 Subject: Make qdbus ugliness more segmented. --- 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 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." -- cgit v1.2.3-54-g00ecf