Skip to content

Commit 2489d5b

Browse files
committed
Autoconnect: Add option to disable autoconnect notification
1 parent bdc48b6 commit 2489d5b

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

blueman/plugins/applet/AutoConnect.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,16 @@ class AutoConnect(AppletPlugin):
2626
"path": None
2727
}
2828
__options__ = {
29-
"services": {"type": list, "default": "[]"}
29+
"services": {
30+
"type": list,
31+
"default": "[]"
32+
},
33+
"notification": {
34+
"type": bool,
35+
"default": True,
36+
"name": "Show notification",
37+
"desc": "Show a notification on successful autoconnect."
38+
},
3039
}
3140

3241
def __init__(self, parent: "BluemanApplet"):
@@ -64,6 +73,9 @@ def _run(self) -> bool:
6473
continue
6574

6675
def reply(dev: Device | None = device, service_name: str = ServiceUUID(uuid).name) -> None:
76+
if not self.get_option("notification"):
77+
return
78+
6779
assert isinstance(dev, Device) # https://github.com/python/mypy/issues/2608
6880
Notification(_("Connected"), _("Automatically connected to %(service)s on %(device)s") %
6981
{"service": service_name, "device": dev.display_name},

data/org.blueman.gschema.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,10 @@
154154
<summary>Services to connect to automatically</summary>
155155
<description>A list of services to connect to stored as tuples with the address and the UUID</description>
156156
</key>
157+
<key type="b" name="notification">
158+
<default>true</default>
159+
<summary>Show notification on successful autoconnect</summary>
160+
</key>
157161
</schema>
158162
<schema id="org.blueman.plugins.recentconns" path="/org/blueman/plugins/recentconns/">
159163
<key type="i" name="max-items">

0 commit comments

Comments
 (0)