Closed NgoHuy closed 4 years ago
You are copying passwords using the X clipboard selection? It seems like Unix sockets would be a better interprocess communication channel, but oh well.
Here's a script you can run which will clear your selection ten seconds after any program has copied something into it:
while xclip -verbose -selection clipboard </dev/null 2>/dev/null; do
echo -n "Waiting... "
sleep 10
echo "Cleared selection"
done
Note that the current version of xclip
on github is buggy and may not work. If you use an older version, for example one that comes with your system's package manager, this script should do what you want.
You can use the '-loops' feature to only serve one request (i.e. only allow it to be pasted once). You can also just select something else if you're using the primary selection (middle-click).
Ken is right. The -loops 1 option is perfect for this. If you have to use the clipboard for secret communication, which I still think is a bad idea, this is better than waiting 10 seconds. It clears the clipboard as soon as you've used it.
thank you, -loops is perfect
Hi, I use xclip for copy/paste from command line, I also use lockwise and bitwarden, they offer clear clipboard after some time. Can you implement it for xclip such as: --clear-time 10s? I know some work around like waiting for 10s then copy blank, but it's nice if it's default behavior.
Best regards, Severus