-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
55 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,74 @@ | ||
# Completion Notifier | ||
|
||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡀⠀⠀ | ||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣿⣿⠆⠀ | ||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣾⣿⡿⠁⠀⠀ | ||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⣿⠟⠀⠀⠀⠀ | ||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣴⣿⣿⡿⠃⠀⠀⠀⠀⠀ | ||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢠⣾⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀ | ||
⠀⢀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣰⣿⣿⣿⠏⠀⠀⠀⠀⠀⠀⠀⠀ | ||
⠀⠺⣿⣷⣄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⣿⣿⠃⠀⠀⠀⠀⠀⠀⠀⠀⠀ | ||
⠀⠀⠈⠻⣿⣿⣦⣄⠀⠀⠀⠀⠀⠀⣠⣿⣿⣿⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ | ||
⠀⠀⠀⠀⠈⠻⣿⣿⣷⣤⡀⠀⠀⣰⣿⣿⣿⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ | ||
⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣦⣼⣿⣿⣿⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ | ||
⠀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣿⣿⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ | ||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠻⣿⣿⣿⡿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ | ||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⢿⡟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ | ||
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ | ||
A simple notifier to send notifications on terminal process events. | ||
|
||
|
||
Usage: completion-notifier [OPTIONS] <RUN>... | ||
## Installation | ||
|
||
Arguments: | ||
<RUN>... | ||
Install directly from source | ||
|
||
Options: | ||
-p, --profiles <PROFILES> [default: default] | ||
-n, --name <NAME> | ||
-t, --triggers <TRIGGERS> | ||
-v, --verbose | ||
-h, --help Print help | ||
-V, --version Print version | ||
```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`. | ||
|
||
## config | ||
```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 | ||
|
||
```markdown | ||
```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 = "" | ||
|
||
``` |