Network Speed Monitor is a GNOME extension that displays the current network speed on the top bar of your Ubuntu desktop. It provides a real-time view of your download and upload speeds, helping you monitor your network usage efficiently.
- Real-time network speed monitoring
- Easy-to-read display on the top bar
- Customizable refresh interval
- Supports multiple network interfaces
To install the Network Speed Monitor extension:
-
Download the extension:
- Clone the repository to your local machine:
git clone https://github.com/ajxv/netspeed-monitor.git
- Clone the repository to your local machine:
-
Install the extension:
- Copy the extension files to the GNOME extensions directory:
cp -r netspeed-monitor ~/.local/share/gnome-shell/extensions/netspeed-monitor@ajxv/
- Copy the extension files to the GNOME extensions directory:
-
Enable the extension:
- Open GNOME Tweaks and navigate to the Extensions tab, then enable the Network Speed Monitor extension.
- Alternatively, you can enable the extension using the command line:
gnome-extensions enable netspeed-monitor@ajxv
-
Restart GNOME Shell:
- Press
Alt + F2
, typer
, and pressEnter
to restart GNOME Shell.
- Press
Once installed and enabled, the Network Speed Monitor extension will display the current download (↓) and upload (↑) speeds on the top bar of your Ubuntu desktop. The speeds are updated every few seconds based on the configured refresh interval.
The extension reads network statistics from /proc/net/dev
, a Linux kernel interface that provides cumulative network traffic statistics. This file contains rows for each network interface with various counters including bytes received (RX) and transmitted (TX).
-
Data Collection
- The system reads
/proc/net/dev
every 3 seconds - Interface statistics are aggregated, excluding virtual interfaces (lo, vir, vbox, docker, br-)
- Two primary values are tracked:
- Total bytes received (RX)
- Total bytes transmitted (TX)
- The system reads
-
Speed Calculation Formula
- Speed = (Current Bytes - Previous Bytes) / Interval Time - RX Speed = (Current RX Bytes - Previous RX Bytes) / 3 seconds - TX Speed = (Current TX Bytes - Previous TX Bytes) / 3 seconds
-
Unit Conversion The raw byte values are converted to human-readable formats using the following scale:
- B/s (Bytes/second) : < 1024 B/s
- KB/s (Kilobytes/second) : < 1024 KB/s
- MB/s (Megabytes/second) : < 1024 MB/s
- GB/s (Gigabytes/second) : ≥ 1024 MB/s
- Update Interval: 3 seconds (configurable via
UPDATE_INTERVAL_SECONDS
) - Interface Filtering: Uses prefix matching to exclude virtual interfaces
- Error Handling: Continues operation even if a single reading fails
- Memory Usage: Maintains only previous reading state (2 integers)
- Display Format: "↓ {download_speed} ↑ {upload_speed}"
- CPU Impact: Minimal (reads one file every 3 seconds)
- Memory Footprint: Constant (independent of network activity)
- I/O Operations: One file read per update interval
Contributions are welcome to the Network Speed Monitor extension! To contribute, follow these steps:
-
Fork the repository.
-
Clone your fork:
git clone https://github.com/YOUR-USERNAME/netspeed-monitor.git
-
Create a new branch:
git checkout -b my-feature-branch
-
Make your changes.
-
Test your changes.
-
Commit your changes:
git add . git commit -m "Description of your changes"
-
Push your changes:
git push origin my-feature-branch
-
Create a pull request.
This project is licensed under the MIT License.