Skip to content

Commit

Permalink
Merge pull request #4 from n3tw0rth/dev
Browse files Browse the repository at this point in the history
chore(docs): update readme
  • Loading branch information
n3tw0rth authored Jan 11, 2025
2 parents 204f58e + 90265dd commit 1e87607
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 44 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ anyhow = "1.0.95"
clap = { version = "4.5.23", features = ["derive"] }
ctrlc = "3.4.5"
dirs = "5.0.1"
duct = "0.13.7"
futures = "0.3.31"
lettre = "0.11.11"
mail-send = "0.4.9"
Expand Down
108 changes: 65 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,74 @@
<pre>
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣿⣿⠆⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⡿⠁⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⣿⠟⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣴⣿⣿⡿⠃⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣾⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀
⠀⢀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⣿⣿⣿⠏⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠺⣿⣷⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⣿⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠈⠻⣿⣿⣦⣄⠀⠀⠀⠀⠀⠀⣠⣿⣿⣿⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠈⠻⣿⣿⣷⣤⡀⠀⠀⣰⣿⣿⣿⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣦⣼⣿⣿⣿⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣿⣿⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠻⣿⣿⣿⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢿⡟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀


Usage: completion-notifier [OPTIONS] <RUN>...

Arguments:
<RUN>...

Options:
-p, --profiles <PROFILES> [default: default]
-n, --name <NAME>
-t, --triggers <TRIGGERS>
-v, --verbose
-h, --help Print help
-V, --version Print version

</pre>


## config

```markdown
# Completion Notifier

A simple notifier to send notifications on terminal process events.


## Installation

Install directly from source

```bash
$ git clone https://github.com/n3tw0rth/completion-notifier.git
$ cd completion-notifier
$ ./install.sh

$ completion-notifier -v
$ completion-notifier -h
```

it is better to use a alias for the binary,
```bash
#.bashrc
alias notif='completion-notifier'
```
## Usage

It is easy as passing the command directly, by default a notification will be send once the program completes execution success or failed.

```shell
$ completion-notifier ping google.com
```
### Triggers
Triggers can be added to send custom notifications based on the requirement. for example,

```shell
$ completion-notifier -t PING ping google.com
```
program will start running as usual, and will send additionals notifications before process exit. Based on the string values passed into the `-t` flag. According to this example a notification will be send when program find a specific line contain the word `PING`.

```shell
$ completion-notifier -t approve,'Enter a value' terraform apply
```
flag `-t` will accept comma seperated values, and trigger values containing more words seperated by spaces they can be passed in as shown. In this example user will be notified when there undefined variables and when terraform ask for user confirmation to apply the change.
## Configuration

```toml
[email.default]
from = ""
to = ""
api_key = ""
port = 587
from = "[email protected]"
to = "[email protected]"
username = ""
password = ""
port = 465
host = ""

[email.work]
from = "[email protected]"
to = "[email protected]"
username = ""
password = ""
port = 465
host = ""

[profiles.default]
print_output = true
sendto = ["email.default"]
sendto = ["desktop","email.default"]

[gchat.default]
[profiles.work]
print_output = true
sendto = ["desktop","gchat.work","email.work"]

[gchat.work]
api_key = ""
webhook = ""

```

0 comments on commit 1e87607

Please sign in to comment.