naglfar / krunner-keepassxc

A small krunner plugin to copy keepassxc entries to clipboard using its Freedesktop.org Secret Service dbus integration.
MIT License
27 stars 3 forks source link

krunner-keepassxc

A krunner plugin to copy keepassxc entries to clipboard using its Freedesktop.org Secret Service dbus integration.

:warning: with one of the newer versions (^2.7.1) keepassxc will turn off secret service integration until you disable kwallet. Either that or the newer versions of KDE plasma (^5.25) turn kwallet on if it used to be off. Not sure, but if the plugin suddenly stops working this might be the reason.

Usage

You can install the plugin through the krunner settings dialog or alternatively find it on the web store, download the archive, extract and run the install.sh, which should get everything up and running.

Requirements:

Enable Secret Service in KeepassXC:

Usage Instructions:

config file

On first start the plugin will create a config file with default values in ~/.config/krunner-keepassxc/config (~/.config being $XDG_CONFIG_HOME) where you can add a few settings:

The config file gets read on startup, which you can trigger manually by running systemctl restart --user krunner-keepassxc.service

Other Information:

As this is a python application communicating with krunner through D-Bus it needs to be running constantly, for this purpose the install script will place the executable at ~/.local/bin/krunner-keepassxc (you can run this for the CLI) and place a systemd unit file at ~/.config/systemd/user/ to control it. If you're not using systemd a KDE autostart script will be created instead.

more manual ways of getting started

start using pyz file

Just download krunner-keepassxc.pyz and you're good to go!
This is a fully self-contained Python zipapp with included dependencies (see github.com/linkedin/shiv)

$ ./krunner-keepassxc.pyz   # or do $ python krunner-keepassxc.pyz

start using pip

this will pull the files and dependencies (dbus-python, cryptography) into your global python installation

$ sudo pip3 install https://github.com/naglfar/krunner-keepassxc/releases/download/1.8.3/krunner_-_keepassxc-1.8.3-py3-none-any.whl
# see if it works:
$ python3 -m krunner-keepassxc -l  # should list all the password labels in your database
$ python3 -m krunner-keepassxc run  # will start the dbus service for communicating with krunner

using poetry

mostly for development

$ git clone git@github.com:naglfar/krunner-keepassxc.git
$ cd krunner-keepassxc
$ poetry install
$ poetry run cli -l # should list all the password labels in your database

installing the krunner plugin

copy install/krunner-keepassxc.desktop to ~/.local/share/kservices5/ after this krunner-keepassxc should already show up in krunner plugins but might require a reboot to actually work

running the script in background / on startup

via autostart

edit install/krunner-keepassxc_autostart.desktop and uncomment your scenario, then copy to ~/.config/autostart/

via systemd

edit install/krunner-keepassxc.service and uncomment your scenario, then copy to ~/.config/systemd/user/

$ systemctl --user enable krunner-keepassxc && systemctl --user start krunner-keepassxc