From 6b39eabdd4b461574a6aead8c89d99e04308f2bc Mon Sep 17 00:00:00 2001 From: samedamci Date: Tue, 10 Mar 2020 18:14:59 +0100 Subject: [PATCH] Add script to clip passwords from keepassxc-cli using rofi menu --- botfiles/.config/QtProject.conf | 4 ++-- botfiles/.config/keepassxc/keepassxc.ini | 14 ++++++++++++++ botfiles/.scripts/passworder.sh | 7 +++++++ 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100755 botfiles/.scripts/passworder.sh diff --git a/botfiles/.config/QtProject.conf b/botfiles/.config/QtProject.conf index 1dd41de..444cad0 100644 --- a/botfiles/.config/QtProject.conf +++ b/botfiles/.config/QtProject.conf @@ -1,6 +1,6 @@ [FileDialog] -history=file:///home/samedamci/Downloads, file:///home/samedamci/.minecraft/screenshots, file:///mnt/HDD/samedamci/Videos, file:///home/samedamci/Pictures/Screenshots, file:///home/samedamci/.minecraft/resourcepacks/Resourcedamci/assets/minecraft/textures/entity/fox -lastVisited=file:///home/samedamci/Pictures/Screenshots +history=file:///home/samedamci/Downloads, file:///home/samedamci/.minecraft/screenshots, file:///mnt/HDD/samedamci/Videos, file:///home/samedamci/Pictures/Screenshots, file:///home/samedamci/.minecraft/resourcepacks/Resourcedamci/assets/minecraft/textures/entity/fox, file:///home/samedamci/Passwords +lastVisited=file:///home/samedamci/Passwords qtVersion=5.14.1 shortcuts=file:, file:///home/samedamci, file:///home/samedamci/Pictures, file:///home/samedamci/.minecraft sidebarWidth=90 diff --git a/botfiles/.config/keepassxc/keepassxc.ini b/botfiles/.config/keepassxc/keepassxc.ini index 090c8a7..ecdd485 100644 --- a/botfiles/.config/keepassxc/keepassxc.ini +++ b/botfiles/.config/keepassxc/keepassxc.ini @@ -1,3 +1,17 @@ [General] HideWindowOnCopy=false +LastActiveDatabase=@Invalid() +LastDatabases=/home/samedamci/Passwords/keepass.kdbx +LastDir=/home/samedamci/Passwords +LastOpenedDatabases=@Invalid() MinimizeOnCopy=true + +[GUI] +HidePasswords=true +HideUsernames=false +ListViewState=@ByteArray(\0\0\0\xff\0\0\0\0\0\0\0\x1\0\0\0\0\0\0\0\x1\x1\0\0\0\0\0\0\0\0\0\0\0\r\x1\0\0\0\0\x1\0\0\0\0\0\0\0\x64\0\0\x4\x64\0\0\0\r\x1\x1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x64\0\0\0\x18\0\0\0\x81\0\0\0\0\0\0\0\r\0\0\0\0\0\0\0\x1\0\0\0\0\0\0\0\x64\0\0\0\x1\0\0\0\0\0\0\0\x64\0\0\0\x1\0\0\0\0\0\0\0\x64\0\0\0\x1\0\0\0\0\0\0\0\x64\0\0\0\x1\0\0\0\0\0\0\0\x64\0\0\0\x1\0\0\0\0\0\0\0\x64\0\0\0\x1\0\0\0\0\0\0\0\x64\0\0\0\x1\0\0\0\0\0\0\0\x64\0\0\0\x1\0\0\0\0\0\0\0\x64\0\0\0\x1\0\0\0\0\0\0\0\x18\0\0\0\x1\0\0\0\x2\0\0\0\x64\0\0\0\x1\0\0\0\0\0\0\0\x64\0\0\0\x1\0\0\0\0\0\0\x3\xe8\x1\0\0\0\x64) +MainWindowGeometry=@ByteArray(\x1\xd9\xd0\xcb\0\x3\0\0\0\0\0\x4\0\0\0\x1d\0\0\aw\0\0\x4/\0\0\0\x6\0\0\0\x1f\0\0\au\0\0\x4-\0\0\0\0\0\0\0\0\a\x80\0\0\0\x6\0\0\0\x1f\0\0\au\0\0\x4-) +MainWindowState=@ByteArray(\0\0\0\xff\0\0\0\0\xfd\0\0\0\0\0\0\ap\0\0\x3\xd6\0\0\0\x4\0\0\0\x4\0\0\0\b\0\0\0\b\xfc\0\0\0\x1\0\0\0\x2\0\0\0\x1\0\0\0\xe\0t\0o\0o\0l\0\x42\0\x61\0r\x1\0\0\0\0\xff\xff\xff\xff\0\0\0\0\0\0\0\0) +PreviewSplitterState=@Invalid() +SearchViewState=@ByteArray() +SplitterState=@Invalid() diff --git a/botfiles/.scripts/passworder.sh b/botfiles/.scripts/passworder.sh new file mode 100755 index 0000000..96ea7a1 --- /dev/null +++ b/botfiles/.scripts/passworder.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env zsh + +rofi -dmenu -i -p "Enter your database password" -l 0 | read DBpass + +echo $DBpass | keepassxc-cli ls ~/Passwords/keepass.kdbx | grep -v 'Enter' | rofi -dmenu -i -p "Entry list" -l 30 | read entry + +echo $DBpass | keepassxc-cli clip ~/Passwords/keepass.kdbx $entry