eff

command module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2026 License: 0BSD Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

eff

Test Go Reference Go Report Card

Network connectivity monitor. Continuously pings a target and sends desktop notifications when your connection drops or recovers.

Install

# From source
go install github.com/taigrr/eff@latest

# Or download from releases

Usage

# Default: ping 1.1.1.1 every 3s, notify on state changes
eff

# Custom target and interval
eff --interval 5s --threshold 5 8.8.8.8

# Disable notifications (log only)
eff --notify=false

# Use raw ICMP sockets when running with the required privileges
eff --privileged

# Debug mode (show each ping)
eff --debug
Flags
Flag Default Description
--interval, -i 3s Ping interval
--threshold, -t 3 Consecutive failures before declaring down
--notify, -n true Send desktop notifications
--privileged false Use privileged raw ICMP sockets
--debug false Show individual ping results

How It Works

  1. Sends ICMP pings at the configured interval
  2. After N consecutive failures (threshold), declares the network down
  3. Sends a desktop notification (notify-send on Linux, osascript on macOS)
  4. When pings succeed again, declares the network up and reports downtime duration

Systemd Service

Run as a persistent user service:

cp contrib/eff.service ~/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user enable --now eff

The bundled unit is designed for systemctl --user and sets the desktop session environment needed for notify-send. See contrib/README.md for details and troubleshooting.

Library Usage

The monitor is importable:

import "github.com/taigrr/eff/monitor"

m := monitor.New(monitor.Config{
    Target:    "1.1.1.1",
    Interval:  3 * time.Second,
    Threshold: 3,
    OnStateChange: func(e monitor.Event) {
        fmt.Printf("Network %s\n", e.State)
    },
})

m.Run(ctx)

Background

Built because Xfinity says 500mbps but streams at 0.1mbps. This tool tells you the moment your connection actually drops — no more wondering if it's you or the ISP.

License

Released under the 0BSD license.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package monitor provides continuous network connectivity monitoring using ICMP ping.
Package monitor provides continuous network connectivity monitoring using ICMP ping.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址