aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHsieh Chin Fan <pham@topo.tw>2022-12-14 12:20:18 +0800
committerHsieh Chin Fan <pham@topo.tw>2022-12-14 12:20:18 +0800
commit3989fac493212ac53d78ea9bbd3f8ebd8d54085e (patch)
treec84dcdc330f94167547fa311384e24409cc1d5a1
parent17da497733e75d2fdce1d53f03394cf3b72bc5d6 (diff)
Copy username to clipboard selection
-rwxr-xr-xX11/rofi/pass.get3
1 files changed, 2 insertions, 1 deletions
diff --git a/X11/rofi/pass.get b/X11/rofi/pass.get
index b6560b0..ffe7988 100755
--- a/X11/rofi/pass.get
+++ b/X11/rofi/pass.get
@@ -36,7 +36,8 @@ fi
36RESULT="$(pass $1)" 36RESULT="$(pass $1)"
37if [ -n "$RESULT" ]; then 37if [ -n "$RESULT" ]; then
38 # Copy the given password into clipboard 38 # Copy the given password into clipboard
39 echo "$RESULT" | head -1 | tr -d '\n' | xsel -i -t 30000 39 echo "$RESULT" | sed -n 1p | tr -d '\n' | xsel -i -t 30000
40 echo "$RESULT" | sed -n 2p | tr -d '\n' | xsel -ib
40 41
41 # And show extra message 42 # And show extra message
42 EXTRA="$(echo; echo; echo "$RESULT" | sed '1d' | sed '1{/^$/d}')" 43 EXTRA="$(echo; echo; echo "$RESULT" | sed '1d' | sed '1{/^$/d}')"