59 lines
1.8 KiB
Bash
Executable File
59 lines
1.8 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Ping Monitor Extension Installer for GNOME Shell 48+
|
|
# This script installs the Ping Monitor extension to your local GNOME Shell extensions directory
|
|
|
|
set -e
|
|
|
|
EXTENSION_UUID="ping-monitor@sfont.teldat.com"
|
|
EXTENSION_DIR="$HOME/.local/share/gnome-shell/extensions/$EXTENSION_UUID"
|
|
|
|
echo "Installing Ping Monitor Extension for GNOME Shell 48+"
|
|
echo "======================================================"
|
|
echo
|
|
|
|
# Create extensions directory if it doesn't exist
|
|
echo "Creating extensions directory..."
|
|
mkdir -p "$HOME/.local/share/gnome-shell/extensions"
|
|
|
|
# Copy extension files
|
|
echo "Copying extension files..."
|
|
if [ -d "$EXTENSION_DIR" ]; then
|
|
echo "Extension directory already exists. Removing old version..."
|
|
rm -rf "$EXTENSION_DIR"
|
|
fi
|
|
|
|
cp -r "$(dirname "$0")" "$EXTENSION_DIR"
|
|
|
|
# Compile schema
|
|
echo "Compiling GSettings schema..."
|
|
cd "$EXTENSION_DIR"
|
|
glib-compile-schemas schemas/
|
|
|
|
# Make ping.sh executable
|
|
echo "Setting permissions..."
|
|
chmod +x "$EXTENSION_DIR/ping.sh"
|
|
|
|
# Create example config if it doesn't exist
|
|
if [ ! -f "$HOME/.config/ping-monitor.conf" ]; then
|
|
echo "Creating example configuration file at ~/.config/ping-monitor.conf..."
|
|
cp "$EXTENSION_DIR/ping-monitor.conf.example" "$HOME/.config/ping-monitor.conf"
|
|
echo "You can edit this file to configure your ping targets."
|
|
else
|
|
echo "Configuration file already exists at ~/.config/ping-monitor.conf"
|
|
fi
|
|
|
|
echo
|
|
echo "Installation complete!"
|
|
echo
|
|
echo "To enable the extension:"
|
|
echo " 1. On X11: Press Alt+F2, type 'r', and press Enter to restart GNOME Shell"
|
|
echo " 2. On Wayland: Log out and log back in"
|
|
echo " 3. Run: gnome-extensions enable $EXTENSION_UUID"
|
|
echo
|
|
echo "Or use the Extensions app to enable it."
|
|
echo
|
|
echo "Configuration file: ~/.config/ping-monitor.conf"
|
|
echo "Edit this file and reload the extension to change ping targets."
|
|
echo
|