Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Support for x-kde-passwordManagerHint mime type #2611

Open
enbrnz opened this issue Jun 26, 2023 · 4 comments
Open

[Feature Request] Support for x-kde-passwordManagerHint mime type #2611

enbrnz opened this issue Jun 26, 2023 · 4 comments

Comments

@enbrnz
Copy link

enbrnz commented Jun 26, 2023

Summary

If this mime type is set to secret it will prevent the clipboard entry to be added to Klipper.

See https://phabricator.kde.org/D12539

This is the link to the PR in kepassxc: keepassxreboot/keepassxc#1969

Environment

  • OS: Linux / KDE Plasma 5+
@enbrnz
Copy link
Author

enbrnz commented Jun 28, 2023

I'm on Fedora 38 (KDE) was able to create the following workaround:
Requirements:

  • wl-clipboard
  • ydotool

Install ydotool, start it as background service:

sudo dnf install ydootool
sudo -b ydotoold -m --socket-path="/run/user/1000/.ydotool_socket" --socket-own="$(id -u):$(id -g)"
# still need to create a user systemd file for that

Create a custom clipboard script according to the gpaste documentation:
https://github.com/gopasspw/gopass/blob/master/docs/usecases/gpaste.md

However my gopass_clipboard_copy_cmd.sh looks like this:

#!/bin/sh

# wl-copy -o deletes the password after first paste
# --type sets mime type to prevent password from showing up in Klipper
# <&0 redirects standard input
wl-copy -o --type x-kde-passwordManagerHint/secret <&0

And the gopass_clipboard_clear_cmd.sh like that:

#!/bin/sh

wl-copy -c

^ might clear the clipboard unecessarily, as the password has been removed after pasting it.

Then I created a custom shortcut for ctrl+alt+v which runs:

# sleep is necessary otherwise it already starts typing while still pressing keys
sleep .3s; wl-paste | ydotool type -f -

@AnomalRoil
Copy link
Member

I wonder if this might not also be achieved using our hook system. https://github.com/gopasspw/gopass/blob/7e98db57a350dc669c1b8899a9d0511c40cf9667/docs/hooks.md

@enbrnz
Copy link
Author

enbrnz commented Jul 6, 2023

I wonder if this might not also be achieved using our hook system. https://github.com/gopasspw/gopass/blob/7e98db57a350dc669c1b8899a9d0511c40cf9667/docs/hooks.md

What exactly would you use it for?

I mean, if you run gopass show -c a post hook will come too late (the Klipper history is already gone).

Could you use it to make ydotool unecessary?

I'd prefer not to run an additional daemon. Though ydotool does have the advantage that pasting would also work in some VM consoles where it can sometimes be difficult to paste a password.

@dominikschulz
Copy link
Member

I don't this can be done with the help of hooks.

The problem here is that we rely on an external dependency that handles most clipboard interactions for us.
To support this FR we would need to ditch that, at lest on Linux, and then start handling all clipboard interactions ourselves. Not a complete no-go, but something to carefully consider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants