ping-monitor/README.md

6.7 KiB

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

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:

sudo apt-get install gir1.2-gtop-2.0 gir1.2-clutter-1.0

On Fedora:

sudo dnf install libgtop2-devel

On Arch Linux:

sudo pacman -S libgtop

On openSUSE:

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:
cd ~/Downloads
# If you already have the ping-monitor-gnome48 directory, you're good to go
  1. Copy the extension to your local extensions directory:
mkdir -p ~/.local/share/gnome-shell/extensions
cp -r ~/Downloads/ping-monitor-gnome48 ~/.local/share/gnome-shell/extensions/ping-monitor@sfont.teldat.com
  1. Compile the schema (required):
cd ~/.local/share/gnome-shell/extensions/ping-monitor@sfont.teldat.com
glib-compile-schemas schemas/
  1. Restart GNOME Shell:

    • On X11: Press Alt + F2, type r, and press Enter
    • On Wayland: Log out and log back in
  2. Enable the extension:

gnome-extensions enable ping-monitor@sfont.teldat.com

If you want to easily test changes:

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:

{
  "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:
gnome-extensions prefs ping-monitor@sfont.teldat.com
  1. 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:
cd ~/.local/share/gnome-shell/extensions/ping-monitor@sfont.teldat.com
glib-compile-schemas schemas/
  1. Check if the extension is enabled:
gnome-extensions list
gnome-extensions enable ping-monitor@sfont.teldat.com
  1. Restart GNOME Shell

No ping data showing

  1. Verify your configuration file exists and is valid JSON:
cat ~/.config/ping-monitor.conf
  1. Check the logs for errors:
journalctl -f -o cat /usr/bin/gnome-shell
  1. Ensure you have network connectivity and can ping the configured addresses:
ping -c 2 8.8.8.8

Permission errors

The ping.sh script needs to be executable:

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

Based on 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/.