Comments (12)
I've got it working for me with this code:
def send_password_to_native_clipboard(self, name):
pass_cmd = subprocess.run(['pass', 'show', '-c', name])
if pass_cmd.returncode:
self.notify('Failed to copy password!', error=True)
else:
self.notify('Password {} copied to clipboard.'.format(name))
By not creating pipes from the stdin/stdout it works, but I loose the context for error messages, not optimal but works for me...
from gnome-pass-search-provider.
if you use the hints:
{'transient': True}
then they do not stay in the history (hints is the argument before the timeout.
from gnome-pass-search-provider.
Whoah, I didn't realize there was any user of this beside me yet :)
Yeah, good points I'll look into adding some libnotify notifications with stderr output when pass exits != 0 and when a password is copied to clipboard.
from gnome-pass-search-provider.
I guess you can use DBus directly e.g.:
notifications_dbus = session_bus.get_object('org.freedesktop.Notifications', '/org/freedesktop/Notifications')
notify = dbus.Interface(notifications_dbus, 'org.freedesktop.Notifications')
notify.Notify (name, 0, '', ' password copied.', '', '', '', 3000)
I'm no dbus expert or python but this gives me some hints, it probably needs some polishing specially with the messages and defaults but again i just looked at the spec for 5 minutes....
from gnome-pass-search-provider.
I've added it. Notifications seems to stay indefinitely in Gnome notifications history despite setting a 3s timeout though. Also I barely tested :)
from gnome-pass-search-provider.
👍
from gnome-pass-search-provider.
Also for some strange reason on my Fedora 26 notifications have a huge delay before they show up. How do you debug this?
from gnome-pass-search-provider.
I changed notifications to be transient. I have no idea why you would have a delay when notifications show up, I don't have the problem.
from gnome-pass-search-provider.
it seems like a deadlock on the subprocess until some timeout happens
from gnome-pass-search-provider.
Also for some strange reason on my Fedora 26 notifications have a huge delay before they show up.
And it's pretty annoying as well …
from gnome-pass-search-provider.
Thanks, that works well. However, that means no GPaste support but I personally do not use that anyway.
from gnome-pass-search-provider.
@pmlopes : I imported your version of the function.
@matze : The problem doesn't occur with GPaste support anyway (which is why I didn't see it) as it seems to be due to the subprocess call blocking until the end of the 45 seconds before clearing the clipboard content, which isn't used in the case of GPaste.
from gnome-pass-search-provider.
Related Issues (16)
- [Request] Package for Nix or publish on extensions.gnome.org HOT 1
- Arch Linux: Unable to install due to permissions for /usr/lib/... HOT 2
- flatpak build HOT 1
- Doesn't work with 3.34 HOT 8
- GPG called two times when gpaste is not installed HOT 2
- Writing an Ebuild for Gentoo HOT 7
- Pass entries don't show up in search HOT 5
- Environment variable loading HOT 2
- Failed to copy password on gnome40 without Gpaste HOT 6
- fuzzywuzzy was renamed to thefuzz HOT 1
- When gpg is updated, but old gpg-agent is still running, passwords are not copied HOT 2
- AttributeError: 'bool' object has no attribute 'lower' HOT 1
- Do not ask for unlock password automatically? HOT 1
- about debian HOT 1
- [Request] Case-insensitive search HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gnome-pass-search-provider.