ping-monitor/README.md

250 lines
6.7 KiB
Markdown

# Ping Monitor for GNOME Shell 48+
A GNOME Shell extension that displays network ping information in the status bar. This is a modernized version compatible with GNOME Shell 45, 46, 47, and 48.
![Ping Monitor](https://user-images.githubusercontent.com/placeholder/ping-monitor.png)
## Features
- Monitor multiple network endpoints simultaneously
- Visual status indicators with customizable colors
- Real-time ping statistics in the panel
- Configurable refresh intervals and ping parameters
- Tooltip with detailed ping information
- Dropdown menu with comprehensive statistics
## Prerequisites
This extension requires GNOME Shell 45 or later (tested on GNOME Shell 48.4).
Before installing this extension, ensure you have the necessary system packages installed:
### On Ubuntu/Debian:
```bash
sudo apt-get install gir1.2-gtop-2.0 gir1.2-clutter-1.0
```
### On Fedora:
```bash
sudo dnf install libgtop2-devel
```
### On Arch Linux:
```bash
sudo pacman -S libgtop
```
### On openSUSE:
```bash
sudo zypper install gnome-shell-devel libgtop-devel libgtop-2_0-10 typelib-1_0-GTop-2_0
```
## Installation
### Method 1: Manual Installation
1. Clone or download this repository:
```bash
cd ~/Downloads
# If you already have the ping-monitor-gnome48 directory, you're good to go
```
2. Copy the extension to your local extensions directory:
```bash
mkdir -p ~/.local/share/gnome-shell/extensions
cp -r ~/Downloads/ping-monitor-gnome48 ~/.local/share/gnome-shell/extensions/ping-monitor@sfont.teldat.com
```
3. Compile the schema (required):
```bash
cd ~/.local/share/gnome-shell/extensions/ping-monitor@sfont.teldat.com
glib-compile-schemas schemas/
```
4. Restart GNOME Shell:
- On X11: Press `Alt + F2`, type `r`, and press Enter
- On Wayland: Log out and log back in
5. Enable the extension:
```bash
gnome-extensions enable ping-monitor@sfont.teldat.com
```
### Method 2: Development/Testing Installation (with symlink)
If you want to easily test changes:
```bash
mkdir -p ~/.local/share/gnome-shell/extensions
cd ~/.local/share/gnome-shell/extensions
ln -s ~/Downloads/ping-monitor-gnome48 ping-monitor@sfont.teldat.com
cd ping-monitor@sfont.teldat.com
glib-compile-schemas schemas/
gnome-extensions enable ping-monitor@sfont.teldat.com
```
## Configuration
### Create Configuration File
The extension reads its configuration from `~/.config/ping-monitor.conf`. Create this file with the following structure:
```json
{
"debug_output": false,
"ping_config": [
{
"tag": "google",
"name": "Google",
"address": "8.8.8.8",
"ping_count": 2,
"ping_interval": 0.3,
"ping_deadline": 3,
"refresh_interval": 2000,
"active": true,
"visible": true,
"show_name": true,
"show_address": true,
"show_tooltip": true,
"warning_threshold": 20
},
{
"tag": "router",
"name": "Router",
"address": "192.168.0.1",
"ping_count": 2,
"ping_interval": 0.3,
"ping_deadline": 3,
"refresh_interval": 2000,
"active": true,
"visible": true,
"show_name": true,
"show_address": true,
"show_tooltip": true,
"warning_threshold": 20
}
]
}
```
### Configuration Parameters
- **debug_output**: Enable debug logging (true/false)
- **tag**: Unique identifier for the ping target
- **name**: Display name shown in the panel
- **address**: IP address or hostname to ping
- **ping_count**: Number of ping packets to send
- **ping_interval**: Interval between ping packets (seconds)
- **ping_deadline**: Maximum time to wait for all pings (seconds)
- **refresh_interval**: Time between ping operations (milliseconds)
- **active**: Enable this ping target (true/false)
- **visible**: Show in the status bar (true/false)
- **show_name**: Display the name in the panel (true/false)
- **show_address**: Display the address below the name (true/false)
- **show_tooltip**: Show tooltip on hover (true/false)
- **warning_threshold**: Ping time in ms to trigger warning color
### Color Preferences
You can customize the status indicator colors through the extension preferences:
1. Open Extension Preferences:
```bash
gnome-extensions prefs ping-monitor@sfont.teldat.com
```
2. Adjust the colors for:
- **Good**: Successful ping with normal latency
- **Warning**: Successful ping with high latency
- **Bad**: Failed ping or timeout
- **Loss**: Partial packet loss
### Reloading Configuration
After modifying `~/.config/ping-monitor.conf`:
1. Click on the Ping Monitor icon in the status bar
2. Select "Reload config" from the dropdown menu
Or restart GNOME Shell (Alt + F2, type 'r', press Enter on X11).
## Troubleshooting
### Extension doesn't appear after installation
1. Make sure the schema is compiled:
```bash
cd ~/.local/share/gnome-shell/extensions/ping-monitor@sfont.teldat.com
glib-compile-schemas schemas/
```
2. Check if the extension is enabled:
```bash
gnome-extensions list
gnome-extensions enable ping-monitor@sfont.teldat.com
```
3. Restart GNOME Shell
### No ping data showing
1. Verify your configuration file exists and is valid JSON:
```bash
cat ~/.config/ping-monitor.conf
```
2. Check the logs for errors:
```bash
journalctl -f -o cat /usr/bin/gnome-shell
```
3. Ensure you have network connectivity and can ping the configured addresses:
```bash
ping -c 2 8.8.8.8
```
### Permission errors
The ping.sh script needs to be executable:
```bash
chmod +x ~/.local/share/gnome-shell/extensions/ping-monitor@sfont.teldat.com
```
## What's New in This Version
This is a complete modernization for GNOME Shell 45-48:
- ✅ Converted to ES6 modules
- ✅ Uses modern Extension API
- ✅ Updated to GTK4 for preferences
- ✅ Removed deprecated APIs (Lang.bind, old imports system)
- ✅ Modern async/await patterns
- ✅ Compatible with Wayland and X11
- ✅ Updated GObject registration
- ✅ Modern file dialog APIs
## Credits
Original extension by [samuelba](https://github.com/samuelba)
Based on [gnome-shell-system-monitor-applet](https://github.com/paradoxxxzero/gnome-shell-system-monitor-applet)
Modernized for GNOME Shell 48+ by Claude
## License
Copyright (C) 2019 Samuel Bachmann aka samuelba
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.