Merge branch 'master' into improve-notifications

This commit is contained in:
jle64 2019-01-15 17:45:21 +01:00 committed by GitHub
commit d2e472abc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 13 deletions

View File

@ -29,7 +29,7 @@ sudo SYSCONFDIR=/etc DATADIR=/usr/share LIBDIR=/usr/lib LIBEXECDIR=/usr/lib ./in
# Post-installation
Recommended : set gpg agent to use pinentry-gnome3 by adding `pinentry-program /usr/bin/pinentry-gnome3` to `~/.gnupg/.gpg-agent.conf`.
Recommended : set gpg agent to use pinentry-gnome3 by adding `pinentry-program /usr/bin/pinentry-gnome3` to `~/.gnupg/gpg-agent.conf`.
If you are on Xorg, restart GNOME Shell by typing 'alt + f2' then entering 'r' as command.
If you are on Wayland, you need to close and reopen your GNOME session.

View File

@ -7,4 +7,4 @@ Comment=GNOME Shell search provider for pass
Terminal=false
Type=Application
OnlyShowIn=GNOME;
NoDisplay=true;
NoDisplay=true

View File

@ -72,7 +72,7 @@ class SearchPassService(dbus.service.Object):
@dbus.service.method(in_signature='as', out_signature='aa{sv}', **sbn)
def GetResultMetas(self, ids):
return [dict(id=id, name=id,) for id in ids]
return [dict(id=id, name=id, gicon="password-manager") for id in ids]
@dbus.service.method(in_signature='asas', out_signature='as', **sbn)
def GetSubsearchResultSet(self, previous_results, new_terms):
@ -104,14 +104,14 @@ class SearchPassService(dbus.service.Object):
limit=5)]
def send_password_to_gpaste(self, name):
pass_cmd = subprocess.run(
['pass', 'show', name],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE
)
password = re.sub(b'\n$', b'', pass_cmd.stdout)
error = re.sub(b'\n$', b'', pass_cmd.stderr)
if not pass_cmd.returncode:
try:
pass_output = subprocess.check_output(
['pass', 'show', name],
stderr=subprocess.STDOUT,
text=True
)
password = pass_output.split('\n', 1)[0]
self.session_bus.get_object(
'org.gnome.GPaste.Daemon',
'/org/gnome/GPaste'
@ -121,8 +121,9 @@ class SearchPassService(dbus.service.Object):
dbus_interface='org.gnome.GPaste1'
)
self.notify('Copied password to clipboard:', body='<b>{}</b>'.format(name))
else:
self.notify('Failed to copy password', body=error, error=True)
except subprocess.CalledProcessError as error:
self.notify('Failed to copy password!', body=error.output, error=True)
def send_password_to_native_clipboard(self, name):
pass_cmd = subprocess.run(['pass', 'show', '-c', name])