From 1ba339f964f6fa6ed316a66593a76284622756e7 Mon Sep 17 00:00:00 2001 From: Crony Akatsuki Date: Tue, 3 Jan 2023 17:10:21 +0100 Subject: [PATCH] Add ability to copy the entry. --- dmenu-keepassxc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dmenu-keepassxc b/dmenu-keepassxc index 1faa06b..39b4913 100755 --- a/dmenu-keepassxc +++ b/dmenu-keepassxc @@ -2,8 +2,14 @@ # Simple dmenu script to ask for keepassxc database password, and get the password of asked account +. ~/.config/dmenu/config + db=$(grep database ~/.config/dmenu-keepassxc/config | cut -d: -f 2) kf=$(grep keyfile ~/.config/dmenu-keepassxc/config | cut -d: -f 2) -dmenu -P -p "Enter KeePassXC database password" | keepassxc-cli show -sa password -k $kf $db "$@" +if [ "$2" = copy ]; then + $DMENU -P -p "Enter KeePassXC database password" | keepassxc-cli show -sa password -k $kf $db "$1" | xclip -sel c +else + $DMENU -P -p "Enter KeePassXC database password" | keepassxc-cli show -sa password -k $kf $db "$1" +fi