ds4battery icon indicating copy to clipboard operation
ds4battery copied to clipboard

Disconnecting (DS3) controllers?

Open DidierLoiseau opened this issue 3 years ago • 3 comments

In the Bluetooth settings, you can select a controller, and then flip a toggle to disconnect the controller and turn it off:

Screenshot from 2021-04-30 22-49-44

Would it be possible to integrate such a toggle to the extension?

DidierLoiseau avatar Apr 30 '21 20:04 DidierLoiseau

I’m not familiar with extension development, but I notice it is possible to disconnect a device with

bluetoothctl disconnect <deviceid>

where <deviceid> can be obtained from bluetoothctl info but it also seems to match the suffix of the contreller name listed in /sys/class/power_supply.

DidierLoiseau avatar May 08 '21 17:05 DidierLoiseau

Hi! Thanks for pull request, but I think disconnect action on click is not good(maybe create context menu?). Additionally need check connection type: bluetooth or usb.

thankjura avatar May 11 '21 21:05 thankjura

Indeed, the creation of a context menu is one of the remarks I put in the description of the PR itself. I don't know how to implement it properly though, as I don't have experience with extensions development outside this. It seems the right way would be to create a PanelMenu, but I'm not sure how to implement that properly in a retro-compatible way for older versions of Gnome – and how to test it. That is, if you still want to maintain compatibility with Gnome 3.30 (almost 3 years old) and older. Do you actually test your extension on those old Gnome versions?

Concerning the connection type, do you have a suggestion on how to check this? For USB, I guess it would be fine to just disable the menu entry since it does not make sense, I think, to provide a disconnect feature for them.

DidierLoiseau avatar May 12 '21 09:05 DidierLoiseau