GithubHelp home page GithubHelp logo

rnotify's Introduction

Rnotify - Notification manager written in rust

Rnotify sends notifications to various platforms, such as discord and telegram.

Rnotify reads a configuration file in the home directory, .config/rnotify.toml, using the toml configuration format.

Installation

Rnotify can be installed via cargo

cargo install rnotify --all-features

By default, only some destinations are included, include all by using the --all-features flag as shown above.

Updating

To update rnotify, simply re-run

cargo install rnotify --all-features

Basic Usage

Send a (info) notification to all configured destinations

rnotify -m "Message to send"

Send a notification with a title and level

rnotify -t "Title" -l warn -m "Message to send"

Send an error notification using stdin as message

echo "hi" | rnotify -t "Title" -l error

Advanced usage

For more detailed notifications we can use formatted option -f. This allows parsing of sections formatted on a line as #<Section Name># The variables in the echo are created with simple shell commands

echo "
#<Uptime>#
Uptime: $uptime
Today is: $today
#<Services>#
- Check scraper service: $checkerservicestatus
#<Disk Usage>#
\`\`\`$diskspace\`\`\`" | rnotify -t "Daily hello" -a "cron/dailyhello.sh" -f

Using the formatting option of rnotify, we can create something like this: discord notification embed

Configuration file format

Example configuration format that logs to a file and sends notifications to discord.

[[destinations]]
root = true
type = "File"
path = "/var/log/rnotify.log"

[[destinations]]
type = "Discord"
url = "https://discord.com/api/webhooks/.../..."
[[destinations.notify]]
min_level = "Warn"
notify = "<@309009265732091904>" # Notify this user, if the notification level is above a warning.

rnotify's People

Contributors

tyhdefu avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

iisaka51

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.