Require DISABLE_NOTIFICATIONS to be set to True, update README.
This commit is contained in:
parent
62b63dc3e1
commit
e98543973a
@ -74,11 +74,11 @@ user: username
|
|||||||
pin: 123456
|
pin: 123456
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To copy the pin start the search with `:pin` and for the username with `:user`.
|
||||||
|
|
||||||
## Disabling notifications
|
## Disabling notifications
|
||||||
|
|
||||||
Set `DISABLE_NOTIFICATIONS` environment variable.
|
Set the `DISABLE_NOTIFICATIONS` environment variable to `True`.
|
||||||
|
|
||||||
To copy the pin start the search with `:pin` and for the username with `:user`.
|
|
||||||
|
|
||||||
# Alternative password providers
|
# Alternative password providers
|
||||||
|
|
||||||
|
@ -67,8 +67,7 @@ class SearchPassService(dbus.service.Object):
|
|||||||
self.password_executable = getenv("PASSWORD_EXECUTABLE") or "pass"
|
self.password_executable = getenv("PASSWORD_EXECUTABLE") or "pass"
|
||||||
self.password_mode = getenv("PASSWORD_MODE") or "pass"
|
self.password_mode = getenv("PASSWORD_MODE") or "pass"
|
||||||
self.clipboard_executable = getenv("CLIPBOARD_EXECUTABLE") or "wl-copy"
|
self.clipboard_executable = getenv("CLIPBOARD_EXECUTABLE") or "wl-copy"
|
||||||
self.disable_notifications = getenv("DISABLE_NOTIFICATIONS")
|
self.disable_notifications = getenv("DISABLE_NOTIFICATIONS").lower() == "true" or False
|
||||||
self.disable_notifications = self.disable_notifications and self.disable_notifications != "0"
|
|
||||||
|
|
||||||
@dbus.service.method(in_signature="sasu", **sbn)
|
@dbus.service.method(in_signature="sasu", **sbn)
|
||||||
def ActivateResult(self, id, terms, timestamp):
|
def ActivateResult(self, id, terms, timestamp):
|
||||||
@ -222,7 +221,8 @@ class SearchPassService(dbus.service.Object):
|
|||||||
self.notify("Failed to copy password or field!", body=str(e), error=True)
|
self.notify("Failed to copy password or field!", body=str(e), error=True)
|
||||||
|
|
||||||
def notify(self, message, body="", error=False):
|
def notify(self, message, body="", error=False):
|
||||||
if error or not self.disable_notifications:
|
if not error and self.disable_notifications:
|
||||||
|
return
|
||||||
try:
|
try:
|
||||||
self.session_bus.get_object(
|
self.session_bus.get_object(
|
||||||
"org.freedesktop.Notifications", "/org/freedesktop/Notifications"
|
"org.freedesktop.Notifications", "/org/freedesktop/Notifications"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user