ThierryHFR / Big-Sur-StatusArea

macOS Big Sur "System Tray" look for Gnome Desktop
https://www.pling.com/p/1427290/
26 stars 4 forks source link

Battery shows too many decimals #61

Closed ioanmoldovan95 closed 2 years ago

ioanmoldovan95 commented 2 years ago

System: Thinkpad T480 OS: Fedora 35 Gnome Version: 41.3, Wayland

Most probably this happens on laptops with a dual-battery system. The battery percentage has too many decimals and takes a lot of space in the top bar. It should be limited to at most 2 decimals.

ThierryHFR commented 2 years ago

Hi @ioanmoldovan95

Can you modify line 80 of this file ~/.local/share/gnome-shell/extensions/Big-Sur-StatusArea/indicators/power.js

this._percentageLabel.clutter_text.set_markup('<span size="smaller">' + this._power._proxy.Percentage + " %</span>");
# to
this._percentageLabel.clutter_text.set_markup('<span size="smaller">' + this._power._proxy.Percentage.toFixed(2) + " %</span>");

Give me a feedback

ioanmoldovan95 commented 2 years ago

It works!

ThierryHFR commented 2 years ago

Fixed in #69 Thank's