diff --git a/metadata.json b/metadata.json index 5577b3a..1b96bee 100644 --- a/metadata.json +++ b/metadata.json @@ -3,7 +3,7 @@ "name": "WiFi Signal Plus", "description": "Displays WiFi generation (4/5/6/7) in the top bar with detailed connection info on hover", "shell-version": ["45", "46", "47", "48", "49"], - "version": 5, + "version": 6, "url": "https://github.com/JalilArfaoui/gnome-extension-wifi-signal-plus", "donations": { "liberapay": "Jalil" diff --git a/src/extension.ts b/src/extension.ts index 68033c6..698b598 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -41,7 +41,8 @@ import { const REFRESH_INTERVAL_SECONDS = 5; const BACKGROUND_SCAN_INTERVAL_SECONDS = 300; const PLACEHOLDER = '--' as const; -// WiFi 7 theoretical max: 320 MHz, MCS 13 (4096-QAM 5/6), 4×4 MIMO, GI 0.8µs +// WiFi 7 theoretical max: 320 MHz, MCS 13 (4096-QAM 5/6), 4×4 MIMO, GI 0.8µs. +// Speed bar uses logarithmic scale so real-world values fill the gauge meaningfully. const MAX_SPEED_MBPS = 5760; const MAX_CHANNEL_WIDTH_MHZ = 320; const MIN_SIGNAL_DBM = -90; @@ -588,7 +589,8 @@ export default class WifiSignalPlusExtension extends Extension { private getSpeedPercent(info: ConnectedInfo): number { const speed = Math.max(info.txBitrate ?? 0, info.rxBitrate ?? 0, info.bitrate); - return Math.min(100, (speed / MAX_SPEED_MBPS) * 100); + if (speed <= 0) return 0; + return Math.min(100, (Math.log(1 + speed) / Math.log(1 + MAX_SPEED_MBPS)) * 100); } private getWidthPercent(width: ChannelWidthMHz | null): number {