kpsh-menu(1) | General Commands Manual | kpsh-menu(1) |
For kpsh-menu to be useful one must first run kpsh in daemon (server) mode by adding --daemon switch to its commandline options and optionally --socket-path <PATH> to change the default path to the socket through which kpsh-menu communicates with server (kpsh-menu also allows changing socket path).
kpsh-menu doesn't provide any way to open and unlock KeePass database. It managed by kpsh server. For example:
$ kpsh -d --keyfike /path/to/keyfile --password-command "gpg2 -q --decrypt pwd.gpg" /path/to/db.kdbx & $ kpsh-menu
-m, --menu MENU_CMD
-s, --socket-path FILE
-c, --command COMMAND
By default, kpsh-menu will autotype selected entry with a default autotype sequence.
-n, --notify NOTIFY_COMMAND
--pinentry PINENTRY_COMMAND
<DISPLAY_NAME>::<COMMAND>::<FLAGS>
COMMAND: (mandatory) kpsh command. It may contain a placeholder {} which will be replaced with selected entry path.
FLAGS: (optional) a set of flags used to modify behavior of kpsh-menu after selected command is executed (see flags section). See the "Flags" section.
n: (notify) after command execution, kpsh-menu will run a NOTIFY_COMMAND set with --notify option.
$ kpsh-menu -m "dmenu -p '>'" -c "Autotype::autotype '{}'" -c "Username::autotype '{}' -s {USERNAME}::ln" -c "Password::autotype '{}' -s {PASSWORD}::ln" -c "Type TAB::autotype '{} -s {TAB}::l'" -c "Type ENTER::autotype '{} -s {ENTER}::l'" -c "Show::show '{}'" -c "Lock database::lock" -n "notify-send kpsh-menu 'Executed command {cmd}'"
Source code: https://git.goral.net.pl/keepass-shell.git
2024-02-12 |