Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save infirit/50d8d0812da14cb8506279c04e3f73b2 to your computer and use it in GitHub Desktop.
Save infirit/50d8d0812da14cb8506279c04e3f73b2 to your computer and use it in GitHub Desktop.
Patch to allow blueman-2.1 with older pygobject
From d0feb15389e2cf5bbe51372f191cf9684f28d6be Mon Sep 17 00:00:00 2001
From: Sander Sweers <[email protected]>
Date: Thu, 6 Feb 2020 16:53:03 +0100
Subject: [PATCH] Revert "Ask user for auto-power-on setting"
This reverts commit 19c59502cea9673d4b944a6d8950ee5dbfae05fe.
---
blueman/Functions.py | 15 ---------------
blueman/main/Manager.py | 5 +++--
data/org.blueman.gschema.xml | 4 ++--
3 files changed, 5 insertions(+), 19 deletions(-)
diff --git a/blueman/Functions.py b/blueman/Functions.py
index 3b76271e..88111dfb 100644
--- a/blueman/Functions.py
+++ b/blueman/Functions.py
@@ -33,8 +33,6 @@ import fcntl
import struct
import termios
-from blueman.main.Config import Config
-
try:
in_fg = os.getpgrp() == struct.unpack(str('h'), fcntl.ioctl(0, termios.TIOCGPGRP, " "))[0]
except IOError:
@@ -91,19 +89,6 @@ def check_bluetooth_status(message, exitfunc):
exitfunc()
return
- config = Config("org.blueman.plugins.powermanager")
- if config["auto-power-on"] is None:
- d = Gtk.MessageDialog(
- None, type=Gtk.MessageType.QUESTION, icon_name="blueman",
- text=_("Shall bluetooth get enabled automatically?"))
- d.add_button(_("Yes"), Gtk.ResponseType.YES)
- d.add_button(_("No"), Gtk.ResponseType.NO)
-
- resp = d.run()
- d.destroy()
-
- config["auto-power-on"] = resp == Gtk.ResponseType.YES
-
def launch(cmd, paths=None, system=False, icon_name=None, sn=True, name="blueman"):
"""Launch a gui app with starup notification"""
diff --git a/blueman/main/Manager.py b/blueman/main/Manager.py
index 610a895b..d4839de7 100644
--- a/blueman/main/Manager.py
+++ b/blueman/main/Manager.py
@@ -108,8 +108,9 @@ class Blueman(Gtk.Window):
print("Blueman applet needs to be running")
exit()
- check_bluetooth_status(_("Bluetooth needs to be turned on for the device manager to function"),
- lambda: Gtk.main_quit())
+ if 'PowerManager' in self.Applet.QueryPlugins():
+ if not self.Applet.GetBluetoothStatus():
+ bt_status_changed(False)
manager = bluez.Manager()
try:
diff --git a/data/org.blueman.gschema.xml b/data/org.blueman.gschema.xml
index e030b922..09b97371 100644
--- a/data/org.blueman.gschema.xml
+++ b/data/org.blueman.gschema.xml
@@ -131,8 +131,8 @@
</key>
</schema>
<schema id="org.blueman.plugins.powermanager" path="/org/blueman/plugins/powermanager/">
- <key type="mb" name="auto-power-on">
- <default>nothing</default>
+ <key type="b" name="auto-power-on">
+ <default>true</default>
<summary>Automatically power on adapters</summary>
<description></description>
</key>
--
2.24.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment