Notifly for a regular user
Notifly is useful not only for admins and developers. Any Linux, macOS or Windows user can set up:
- a message when the laptop is low on battery or is plugged in,
- an alert that the VPN has disconnected,
- a push when a download/conversion is finished,
- a notification when the internet goes down (from a home NAS),
- smart reminders via
ator Pomodoro timers.
Available recipes
Section titled “Available recipes”| Сценарий | Когда полезно |
|---|---|
| Батарея ноутбука | To avoid missing a battery drain while working with a second monitor |
| VPN | To notice a dropped VPN before it disrupts a meeting |
| Завершение скачивания | yt-dlp, wget, curl, video conversion |
| Потеря интернета | Push from a backup channel (LTE modem) when the main one fails |
| Напоминания и Pomodoro | A flexible alternative to phone reminders |
Principles
Section titled “Principles”- All scripts — in
~/bin/or/usr/local/bin/, token — in~/.notifly.env(chmod 600). - We use the same
notifly-sendshell-wrapper as in the section for sysadmins.
export NOTIFLY_URL="https://your-notifly.example.com"export NOTIFLY_TOKEN="AGdjfk_L.dKe8q"# ~/bin/notifly-send "title" "message" [priority]#!/usr/bin/env bashset -eu; set -a; source ~/.notifly.env; set +aT="${1:?title}"; M="${2:?message}"; P="${3:-5}"curl -fsS -X POST "$NOTIFLY_URL/message?token=$NOTIFLY_TOKEN" \ -H "Content-Type: application/json" \ --data "$(jq -n --arg t "$T" --arg m "$M" --argjson p "$P" \ '{title:$t, message:$m, priority:$p}')" >/dev/nullFor Windows users
Section titled “For Windows users”In the Windows version, a PowerShell function Send-Notifly is used.
Set it up once:
# 1. Put the config in the user's profile@{ url = "https://your-notifly.example.com" token = "AGdjfk_L.dKe8q"} | ConvertTo-Json | Set-Content "$env:USERPROFILE\.notifly.json"
# 2. Place the function next to it and load it at PowerShell startup$fn = @'function Send-Notifly { param([Parameter(Mandatory)][string]$Title, [string]$Message="", [int]$Priority=5) $cfg = Get-Content "$env:USERPROFILE\.notifly.json" -Raw | ConvertFrom-Json $body = @{ title=$Title; message=$Message; priority=$Priority } | ConvertTo-Json -Compress Invoke-RestMethod -Method Post -Uri "$($cfg.url)/message?token=$($cfg.token)" ` -ContentType "application/json; charset=utf-8" ` -Body ([Text.Encoding]::UTF8.GetBytes($body)) -TimeoutSec 10 | Out-Null}'@New-Item -ItemType Directory -Path "$env:USERPROFILE\Documents\WindowsPowerShell" -Force | Out-Null$fn | Set-Content "$env:USERPROFILE\Documents\WindowsPowerShell\Notifly.ps1"
# 3. Load on startup — add to $PROFILEAdd-Content $PROFILE ". `$env:USERPROFILE\Documents\WindowsPowerShell\Notifly.ps1"Test:
Send-Notifly -Title "Тест" -Message "Привет с $env:COMPUTERNAME" -Priority 5From now on, all recipes in this section call this function and are scheduled through Task Scheduler.