From 70fac17e3259150e9ec727e1f84e1d472d71765d Mon Sep 17 00:00:00 2001 From: Cyao <94928179+cheyao@users.noreply.github.com> Date: Tue, 4 Jun 2024 17:59:58 +0200 Subject: [PATCH 1/2] Only show 1 digit after decimal point for battry percentage --- .config/ags/modules/bar/normal/system.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/ags/modules/bar/normal/system.js b/.config/ags/modules/bar/normal/system.js index e97374f1..6ae0676b 100644 --- a/.config/ags/modules/bar/normal/system.js +++ b/.config/ags/modules/bar/normal/system.js @@ -99,7 +99,7 @@ const BarBattery = () => Box({ Label({ className: 'txt-smallie', setup: (self) => self.hook(Battery, label => { - label.label = `${Battery.percent}%`; + label.label = `${Battery.percent.toFixed(1)}%`; }), }), Overlay({ From f62b721a3a078c51aa67c131ea499012610574d3 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Wed, 5 Jun 2024 19:21:01 +0700 Subject: [PATCH 2/2] battery: don't show .0 --- .config/ags/modules/bar/normal/system.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/ags/modules/bar/normal/system.js b/.config/ags/modules/bar/normal/system.js index 6ae0676b..46834642 100644 --- a/.config/ags/modules/bar/normal/system.js +++ b/.config/ags/modules/bar/normal/system.js @@ -99,7 +99,7 @@ const BarBattery = () => Box({ Label({ className: 'txt-smallie', setup: (self) => self.hook(Battery, label => { - label.label = `${Battery.percent.toFixed(1)}%`; + label.label = `${Number.parseFloat(Battery.percent.toFixed(1))}%`; }), }), Overlay({