MichalW / gnome-bluetooth-battery-indicator

Gnome-Shell extension displaying battery percentage for bluetooth devices
GNU General Public License v3.0
121 stars 40 forks source link

Made it work for GNOME 40 #11

Closed egormanga closed 3 years ago

egormanga commented 3 years ago

Fixed incompatible widget fields in the settings. Also fixed the paddings — have never used this extension before, so I don't really know if there was an issue prior to GNOME 40, but I've fixed it anyway.

VFedyk commented 3 years ago

Does it work on Gnome 3.36 which is currently in Ubuntu 20.04 LTS?

egormanga commented 3 years ago

@VFedyk Oh, whoops, I honestly didn't think about it. Probably yes, but anyway it should be pretty easy to merge the code to support both. As I get my hands on Gnome 3.36/38 boxes, will test it out and elaborate.

MichalW commented 3 years ago

@egormanga I have gnome 3.38.3. It shows an error:

hBox.append is not a function
RuiGuilherme commented 3 years ago

@MichalW This update not work on Gnome 3.38.x or below...

@egormanga you need update metadata.json only for Gnome 40.

   "shell-version": [
-    "3.38",
+    "40"
   ]

Old version still available on Gnome Extensions Page but without new features... If you want supporting to older versions, you need add version checking.: https://gjs.guide/extensions/upgrading/gnome-shell-40.html#checking-gnome-shell-version

egormanga commented 3 years ago

Fixed it, by completely rewriting the ui part using GtkBuilder templates instead of (ugly) imperative declaration. Still needs testing on 3.38, as I didn't. Should generally work for both. Hopefully :)

Also, hand-merged with the upstream.

MichalW commented 3 years ago

@egormanga Thanks for the changes. I tested on gnome 3.38 and unfortunately the devices not show up in the settings.

Zrzut ekranu z 2021-06-03 11-47-23

egormanga commented 3 years ago

@MichalW Okay, could you please provide logs using journalctl -f /usr/bin/gnome-shell when opening the settings? I don't have beefy enough machine to run 3.38 box myself at the moment (but might do in a week).

Gouster4 commented 3 years ago

jún 14 20:21:54 arch gnome-shell[4770]: Usage of object.actor is deprecated for Indicator get@resource:///org/gnome/shell/ui/environment.js:317:29 _refresh@/home/pavel/.local/share/gnome-shell/extensions/bluetooth-battery@michalw.github.com/extension.js:80:13 _runLoop@/home/pavel/.local/share/gnome-shell/extensions/bluetooth-battery@michalw.github.com/extension.js:47:14

Indicator shows device icon, but no percentage.

egormanga commented 3 years ago

@Gouster4 Okay cool, what version? I did not mess with extension.js at all, only with the settings window.

egormanga commented 3 years ago

Thanks.