Keepassxc: Add '--lock' option to keepassxc executable

Created on 5 Mar 2019  路  5Comments  路  Source: keepassxreboot/keepassxc

Summary

Add a command to keepassxc-cli that will lock databases of running keepassxc instances.

Desired Behavior

Invoking keepassxc-cli lock (or similar) will lock all running instances of keepassxc of the user invoking the command.

Context

I want to write scripts that lock the database when certain conditions occur. For example when suspending the machine, or when locking the screen (the auto-locking when locking the desktop doesn't seem to work under wayland), or even when the signal of the bluetooth connection to my cellphone gets too weak, indicating I moved away from my machine.

new feature

Most helpful comment

If you're able to use dbus, you can use this command per the Using DBus with KeePassXC wiki page:

qdbus org.keepassxc.KeePassXC.MainWindow /keepassxc org.keepassxc.KeePassXC.MainWindow.lockAllDatabases

The object name is not the same as the service name. Command should be

qdbus org.keepassxc.KeePassXC.MainWindow /keepassxc org.keepassxc.MainWindow.lockAllDatabases

image

All 5 comments

The cli and the desktop app have no communication between each other. I prefer to keep it that way. The proper way to do this is to add the --lock command to keepassxc itself. Single instance will handle the lock message.

I was not aware of the non-communication part, as long as it's possible for me to lock the database non-interactively I'd be fine with whatever alternative works best for the project :)

If you're able to use dbus, you can use this command per the Using DBus with KeePassXC wiki page:

qdbus org.keepassxc.KeePassXC.MainWindow /keepassxc org.keepassxc.KeePassXC.MainWindow.lockAllDatabases

I'll have a look into that, at first glance that would be sufficient for my purposes. Thanks!

If you're able to use dbus, you can use this command per the Using DBus with KeePassXC wiki page:

qdbus org.keepassxc.KeePassXC.MainWindow /keepassxc org.keepassxc.KeePassXC.MainWindow.lockAllDatabases

The object name is not the same as the service name. Command should be

qdbus org.keepassxc.KeePassXC.MainWindow /keepassxc org.keepassxc.MainWindow.lockAllDatabases

image

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shaneknysh picture shaneknysh  路  3Comments

nfnty picture nfnty  路  3Comments

haroldm picture haroldm  路  3Comments

guihkx picture guihkx  路  3Comments

rugk picture rugk  路  3Comments