Merge branch 'master' into improve-notifications
This commit is contained in:
commit
d2e472abc5
@ -29,7 +29,7 @@ sudo SYSCONFDIR=/etc DATADIR=/usr/share LIBDIR=/usr/lib LIBEXECDIR=/usr/lib ./in
|
|||||||
|
|
||||||
# Post-installation
|
# 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 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.
|
If you are on Wayland, you need to close and reopen your GNOME session.
|
||||||
|
@ -7,4 +7,4 @@ Comment=GNOME Shell search provider for pass
|
|||||||
Terminal=false
|
Terminal=false
|
||||||
Type=Application
|
Type=Application
|
||||||
OnlyShowIn=GNOME;
|
OnlyShowIn=GNOME;
|
||||||
NoDisplay=true;
|
NoDisplay=true
|
||||||
|
@ -72,7 +72,7 @@ class SearchPassService(dbus.service.Object):
|
|||||||
|
|
||||||
@dbus.service.method(in_signature='as', out_signature='aa{sv}', **sbn)
|
@dbus.service.method(in_signature='as', out_signature='aa{sv}', **sbn)
|
||||||
def GetResultMetas(self, ids):
|
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)
|
@dbus.service.method(in_signature='asas', out_signature='as', **sbn)
|
||||||
def GetSubsearchResultSet(self, previous_results, new_terms):
|
def GetSubsearchResultSet(self, previous_results, new_terms):
|
||||||
@ -104,14 +104,14 @@ class SearchPassService(dbus.service.Object):
|
|||||||
limit=5)]
|
limit=5)]
|
||||||
|
|
||||||
def send_password_to_gpaste(self, name):
|
def send_password_to_gpaste(self, name):
|
||||||
pass_cmd = subprocess.run(
|
try:
|
||||||
['pass', 'show', name],
|
pass_output = subprocess.check_output(
|
||||||
stdout=subprocess.PIPE,
|
['pass', 'show', name],
|
||||||
stderr=subprocess.PIPE
|
stderr=subprocess.STDOUT,
|
||||||
)
|
text=True
|
||||||
password = re.sub(b'\n$', b'', pass_cmd.stdout)
|
)
|
||||||
error = re.sub(b'\n$', b'', pass_cmd.stderr)
|
password = pass_output.split('\n', 1)[0]
|
||||||
if not pass_cmd.returncode:
|
|
||||||
self.session_bus.get_object(
|
self.session_bus.get_object(
|
||||||
'org.gnome.GPaste.Daemon',
|
'org.gnome.GPaste.Daemon',
|
||||||
'/org/gnome/GPaste'
|
'/org/gnome/GPaste'
|
||||||
@ -121,8 +121,9 @@ class SearchPassService(dbus.service.Object):
|
|||||||
dbus_interface='org.gnome.GPaste1'
|
dbus_interface='org.gnome.GPaste1'
|
||||||
)
|
)
|
||||||
self.notify('Copied password to clipboard:', body='<b>{}</b>'.format(name))
|
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):
|
def send_password_to_native_clipboard(self, name):
|
||||||
pass_cmd = subprocess.run(['pass', 'show', '-c', name])
|
pass_cmd = subprocess.run(['pass', 'show', '-c', name])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user