this post was submitted on 20 May 2026
11 points (100.0% liked)

Linux

17937 readers
58 users here now

Welcome to c/linux!

Welcome to our thriving Linux community! Whether you're a seasoned Linux enthusiast or just starting your journey, we're excited to have you here. Explore, learn, and collaborate with like-minded individuals who share a passion for open-source software and the endless possibilities it offers. Together, let's dive into the world of Linux and embrace the power of freedom, customization, and innovation. Enjoy your stay and feel free to join the vibrant discussions that await you!

Rules:

  1. Stay on topic: Posts and discussions should be related to Linux, open source software, and related technologies.

  2. Be respectful: Treat fellow community members with respect and courtesy.

  3. Quality over quantity: Share informative and thought-provoking content.

  4. No spam or self-promotion: Avoid excessive self-promotion or spamming.

  5. No NSFW adult content

  6. Follow general lemmy guidelines.

founded 3 years ago
MODERATORS
 
  1. Set the custom keyboard shortcut sh -c 'pgrep -i keepassxc > /dev/null || keepassxc' to Alt+V
  2. Keep KeePassXC's default autotype prompt keybinding, which is Alt+V

One disables the other. I thought that going the grep route might make the program opener conditionally inactive, but apparently that's not doing anything. I would really like to avoid using a separate keybinding if possible. Otherwise, I guess I'd just have to have it open on launch.

you are viewing a single comment's thread
view the rest of the comments
[–] HelloRoot@lemy.lol 6 points 1 month ago* (last edited 1 month ago) (2 children)

The problem is that your desktop environment's shortcut handler intercepts Alt+V before KeePassXC ever sees it, so the internal keybinding never fires. And when pgrep finds the process running, your command simply does nothing.

The fix is to use KeePassXC's --auto-type CLI flag, which sends the auto-type signal to a running instance:

Command for your custom shortcut (Alt+V):

bash -c 'pgrep -x keepassxc > /dev/null && keepassxc --auto-type || keepassxc'

Not sure what happens when keepass is minimized / in the system tray though

[–] Flagstaff@programming.dev 2 points 1 month ago* (last edited 1 month ago) (1 children)

Wow, it works; you're a genius!!! Thanks so much!!! Hmm, Lemmy doesn't seem to have post flair, but it does allow title-editing, so I'll just update the post title, haha.

[–] HelloRoot@lemy.lol 1 points 1 month ago

Yeah you probably have to play around with the flags to debug it. I can not look into it right now

[–] Novocirab@feddit.org 1 points 1 month ago

Lovely solution. But I think it should be || instead of && for the goal of the post title, right? ("pull up KeePassXC if it's not already open")