theironrobin / siglo

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

Bluetooth settings button does nothing on non-GNOME #131

Open WhyNotHugo opened 1 week ago

WhyNotHugo commented 1 week ago

Problem description

Clicking the bluetooth settings does nothing, but indicates an error:

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/lib/python3.12/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.12/subprocess.py", line 1955, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'gnome-control-center'

It seems that siglo internally relies on a gnome-specific component for this functionality.

Proposed solution

Perhaps this button should be hidden if gnome-control-center is not in $PATH? This should be trivial to detect with python's shutil.which function.

Related

https://github.com/theironrobin/siglo/issues/84 is somewhat related, but not the same issue, since that one will also reproduce on GNOME.