KEEPMENU(1)

NAME
Keepmenu - Fully featured Dmenu/Rofi frontend for managing Keepass databases.

SYNOPSIS
keepmenu

DESCRIPTION
NOTE: Only supports .kdbx databases, not .kdb. 1. Auto-type username and/or password on selection. No clipboard copy/paste involved. 2. Use a custom Keepass 2.x style auto-type sequence if you have one defined (except for character repetition and the 'special commands'). Set it per entry or set a default in the config file for all entries. Disable autotype for an entry, if desired. 3. Select any single field and have it typed into the active window. Notes fields can be viewed line-by-line from within dmenu and the selected line will be typed when selected. 4. Open the URL in the default web browser from the View/Type menu. 5. Alternate keyboard languages and layouts supported via xdotool or ydotool (for Wayland). 6. Edit entry title, username, URL and password (manually typed or auto-generate). 7. Edit notes using terminal or gui editor (set in config.ini, or uses $EDITOR). 8. Add and Delete entries. 9. Rename, move, delete and add groups. 10. Prompts for and saves initial database and keyfile locations if config file isn't setup before first run. 11. Set multiple databases and keyfiles in the config file and switch databases on the fly. 12. Hide selected groups from the default and 'View/Type Individual entries' views. 13. Keepmenu runs in the background after initial startup and will retain the entered passphrase for pw_cache_period_min minutes after the last activity. 14. Configure the characters and groups of characters used during password generation in the config file (see config.ini.example for instructions). Multiple character sets can be selected on the fly when using Rofi if the `-multi-select` option is passed via `dmenu_command`. 15. Optional Pinentry support for secure passphrase entry. 16. Keepass field references are supported. https://keepass.info/help/base/fieldrefs.html 17. Supports displaying of expiring/expired passwords and shows the expiry time where set 18. Add, edit and type TOTP codes. RFC 6238, Steam and custom settings are supported.

LICENSE
Copyright © 2021 Scott Hansen <firecat4153@gmail.com>. Keepmenu is released under the terms of the GPLv3 license.

REQUIREMENTS
1. Python 3.6+. 2. Pykeepass >= 4.0.0 and pynput. Install via pip or your distribution's package manager, if available. 3. Dmenu or Rofi. Rofi configuration/theming should be done via Rofi themes. 4. (optional) Pinentry. Make sure to set which flavor of pinentry command to use in the config file. 5. (optional) xdotool or ydotool (for Wayland). If you have a lot of Unicode characters or use a non-U.S. English keyboard layout, xdotool/ydotool is necessary to handle typing those characters.

INSTALLATION
1. pip install --user keepmenu. Add ~/.local/bin to $PATH OR 2. In a virtualenv with pip. Link to the executable in <path/to/virtualenv/bin/keepmenu>
    mkvirtualenv keepmenu
    pip install keepmenu
OR 3. From git.
    git clone https://github.com/firecat53/keepmenu
    cd keepmenu
    pip install --user .
OR 4. Available in Archlinux AUR.

CONFIGURATION
1. If you start keepmenu for the first time without a config file, it will prompt you for database and keyfile locations and save them in a default config file. 2. Copy config.ini.example to ~/.config/keepmenu/config.ini, or use it as a reference for additional options.
    Add your database(s) and keyfile(s) To use a command (e.g. gpg) to lookup db password, set password_cmd_<n>. Adjust pw_cache_period_min if desired. Default is 6 hours (360 min). Set the dmenu_command to rofi if you are using that instead Adjust the autotype_default, if desired. Allowed codes are the Keepass 2.x codes except for repetitions and most command codes. {DELAY x} (in milliseconds) is supported. Individual autotype sequences can be edited or disabled inside Keepmenu. Set type_library = xdotool or type_library = ydotool (Wayland) if you need support for non-U.S. English keyboard layouts and/or characters. When using xdotool, call setxkbmap to set your keyboard type somewhere in your window manager or desktop environment initialization. For example:
        exec setxkbmap de in ~/.config/i3/config.
    New sets of characters can be set in config.ini in the [password_chars] section. A new preset for each custom set will be listed in addition to the default presets. If you redefine one of the default sets (upper, lower, digits, punctuation), it will replace the default values. New preset groups of character sets can be defined in config.ini in the [password_char_presets] section. You can set any combination of default and custom character sets. A minimum of one character from each distinct set will be used when generating a new password. If any custom presets are defined, the default presets will not be displayed unless they are uncommented.
3. If using Rofi, pass desired theme via dmenu_command = rofi -theme <theme>.rasi. Dmenu options are also passed via dmenu_command.

WARNING: If you choose to store your database password into config.ini, make sure to chmod 600 config.ini. This is not secure and I only added it as a convenience for testing.

USAGE
1. Run script or bind to keystroke combination 2. Enter database and keyfile if not entered into config.ini already. 3. Start typing to match entries. 4. Hit Enter immediately after dmenu opens ("View/Type individual entries") to switch modes to view and/or type the individual fields for the entry. If selected, the URL will open in the default browser instead of being typed. 5. To view a password without typing it, use the "Edit Entries" option, then select the entry, select "Password" then select "Manually enter password". Type "ESC" to exit without making changes.

Options

keepmenu [-h] [-a AUTOTYPE] [-d DATABASE] [-k KEY_FILE]

--help, -h Output a usage message and exit.

-a AUTOTYPE, --autotype AUTOTYPE Override autotype sequence in config.ini

-d DATABASE, --database DATABASE File path to a database to open, skipping the database selection menu

-k KEYFILE, --keyfile KEY_FILE File path of the keyfile needed to open the database specified by --database/-d

TESTS
1. To run tests: python tests/tests.py