theironrobin / siglo

GTK app to sync InfiniTime watch with PinePhone
Mozilla Public License 2.0
152 stars 24 forks source link

"Bluetooth Settings" buttons doesn't work in flathub version on Fedora 34 #84

Open esijg opened 2 years ago

esijg commented 2 years ago

I am getting the following error when clicking the bluetooth settings button on latest vanilla Fedora 34 (gnome).

Traceback (most recent call last):
  File "/app/share/siglo/siglo/window.py", line 257, in on_bluetooth_settings_clicked
    subprocess.Popen(["gnome-control-center", "bluetooth"])
  File "/usr/lib/python3.8/subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/subprocess.py", line 1706, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'gnome-control-center'
theironrobin commented 2 years ago

I believe this is just a limitation of flatpak. @jwillikers ?

jwillikers commented 2 years ago

Unfortunately, there's no good way to do this that I'm aware of that respects the protections of the sandbox. There might be a portal or D-Bus interface I just don't know about.

theironrobin commented 2 years ago

We are going to have to find a way to detect when the app is running as a flatpak and let the user know that some features will be unavailable.

jwillikers commented 2 years ago

I usually do that by checking if the file /.flatpak-info exists.

alh61 commented 2 years ago

It doesn't work on my Fedora desktop either with native Siglo - but maybe thats because I use Plasma ?

theironrobin commented 2 years ago

Could be - what is the output when opening from the terminal?

alh61 commented 2 years ago

Traceback (most recent call last): File "/usr/share/siglo/siglo/window.py", line 262, in on_bluetooth_settings_clicked subprocess.Popen(["gnome-control-center", "bluetooth"]) File "/usr/lib64/python3.10/subprocess.py", line 969, in init self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib64/python3.10/subprocess.py", line 1845, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] Ingen s?dan fil eller filkatalog: 'gnome-control-center'

well, yes - it won't find gnome-control-center on a plasma (or plasma-mobile) desktop

theironrobin commented 2 years ago

Is there a way to open plasma Bluetooth settings from python? And is there a way for python to tell if it's running under gnome or plasma. 🤔

jwillikers commented 2 years ago

Is there a way to open plasma Bluetooth settings from python? And is there a way for python to tell if it's running under gnome or plasma. thinking

I'm not sure there is anything for Plasma's Bluetooth tool Bluedevil, but I see the underlying Bluetooth Protocol Stack for both, Bluez, has Python bindings available via pybluez.