Installed kpcli from AUR. Everything is working except copying a password to the clipboard. I installed both the additional Perl libraries for the clipboard. When I use xp is says everything has worked but the password is not on the clipboard.
KeePass CLI (kpcli) v3.2 is ready for operation.
Type 'help' for a description of available commands.
Type 'help
kpcli:/> vers
VERSIONS
ReadLine being used: Term::ReadLine::Gnu
Operating system: linux ("Manjaro Linux")
The perl module Clipboard requires the xclip command. Please verify that you have that installed. I don't use Arch Linux often, but on Debian and Ubuntu it is packaged thusly:
Hope this helps. Please reply to the ticket to let me know.
Looks like I have xclip.
$ which xclip
/usr/bin/xclip
[greg@greg-pc ~]$ pacman -Q --info xclip
Name : xclip
Version : 0.13-2
Description : Command line interface to the X11 clipboard
Architecture : x86_64
URL : https://github.com/astrand/xclip
Licenses : GPL
Groups : None
Provides : None
Depends On : libxmu
Optional Deps : None
Required By : perl-clipboard
Optional For : None
Conflicts With : None
Replaces : None
Installed Size : 59.00 KiB
Packager : Gaetan Bisson bisson@archlinux.org
Build Date : Wed 03 Oct 2018 08:13:22 PM ADT
Install Date : Sun 13 Jan 2019 02:37:11 PM AST
Install Reason : Installed as a dependency for another package
Install Script : No
Validated By : Signature
Does xclip from the command line work for you?
...and then paste to test.
Not quite like you have it, but this does:
echo "test copy" | xclip -in -selection clipboard
Just hacking around. If I change Clipboard->copy to Clipboard::Xclip->copy_to_selection then everything works
lines 1788-1791
if (defined($to_copy)) {
Clipboard::Xclip->copy_to_selection("clipboard", $to_copy);
print "Copied $cp_map->{$xNcmd} for \"$ent->{title}\" to the clipboard.\n";
}
Looking at the Clipboard code here: https://metacpan.org/source/KING/Clipboard-0.13/lib/Clipboard/Xclip.pm
I see that the default "-selection" option is "primary", taken from this list, this way (item 0):
...and, with your code change, you overrode that to "clipboard" instead. I am not 100% sure what that is doing in your personal X11 environment, but I suspect this nit to be local to it. You'll need to dig into the various X11 clipboards to try to understand the details. Here is a start:
https://tronche.com/gui/x/icccm/sec-2.html#s-2.6.1
Setting both primary AND clipboard at the same time would be right, see https://specifications.freedesktop.org/clipboards-spec/clipboards-latest.txt :
explicit cut/copy commands (i.e. menu items, toolbar buttons)
should always set CLIPBOARD to the currently-selected data (i.e.
conceptually copy PRIMARY to CLIPBOARD)
explicit cut/copy commands should always set both CLIPBOARD and
PRIMARY, even when copying doesn't involve a selection (e.g. a
"copy url" -option which explicitly copies an url without the
url being selected first)
Last edit: dhobach 2022-03-09
Have you looked at the --xclipsel command line option?
Is that choice what you are referring to?
Thanks, looks like it was implemented in a version newer than mine (3.1).
I'll upgrade then, much appreciated!