From 52af58e39af8ac006c62d1788b6672966b2a9f47 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Fri, 7 Apr 2023 12:46:42 +0800 Subject: Update --- X11/rofi/pass.get | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'X11/rofi/pass.get') diff --git a/X11/rofi/pass.get b/X11/rofi/pass.get index 18230fe..425cd62 100755 --- a/X11/rofi/pass.get +++ b/X11/rofi/pass.get @@ -40,8 +40,8 @@ set -x if [ -n "$RESULT" ]; then # Copy the given password into PRIMARY selection and kill it in 30s echo "$RESULT" | sed -n 1p | tr -d '\n' | xsel -i -t 30000 - # Copy the second line (most of the time, account name) into CLIPBOARD selection - echo "$RESULT" | sed -n 2p | tr -d '\n' | xsel -ib + # Copy the second non-empty line (most of the time, account name) into CLIPBOARD selection + echo "$RESULT" | sed -n '1d;/^./{p;q}' | tr -d '\n' | xsel -ib # And show extra message EXTRA="$(echo; echo; echo "$RESULT" | sed '1d' | sed '1{/^$/d}')" -- cgit v1.2.3-70-g09d2