From 30c2c51828dd3b24408c294e3cf7787dcad6b737 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Wed, 13 Sep 2023 01:11:11 -0400 Subject: [PATCH] fix: round volume values properly --- config/ags/js/bar/audio.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/config/ags/js/bar/audio.js b/config/ags/js/bar/audio.js index 4f90b2d..a44aba4 100644 --- a/config/ags/js/bar/audio.js +++ b/config/ags/js/bar/audio.js @@ -35,16 +35,8 @@ const SpeakerIndicator = params => Icon({ const SpeakerPercentLabel = params => Label({ ...params, connections: [[Audio, label => { - if (!Audio.speaker) - return; - - let vol = Math.floor(Audio.speaker.volume * 100); - - if (vol == 0) { - label.label = vol + '%'; - } - else { - label.label = vol + 1 + '%'; + if (Audio.speaker) { + label.label = Math.round(Audio.speaker.volume * 100) + '%'; } }, 'speaker-changed']], });