Add ability to copy the entry.

This commit is contained in:
CronyAkatsuki 2023-01-03 17:10:21 +01:00
parent 8a285dcb1f
commit 1ba339f964

View File

@ -2,8 +2,14 @@
# Simple dmenu script to ask for keepassxc database password, and get the password of asked account # 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) db=$(grep database ~/.config/dmenu-keepassxc/config | cut -d: -f 2)
kf=$(grep keyfile ~/.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