<commit_before># profanity-notifycmd
Plugin for Profanity to launch a custom shell command when a message is received



## Requirements



## Installation

1. Download the script

2. Launch Profanity

3. Install the plugin with the following command

```
/plugins install ~/profanity-notifycmd/notifycmd.py

```

## Configuration

### Turn the plugin on

`/notifycmd on`

### Turn the plugin off

`/notifycmd off`

### Only notify for the currently active window

`/notifycmd active`

### Enable/Disable notifications for all messages in rooms

`/notifycmd rooms on|off`

### Enable/Disable vibration

`/notifycmd command <command>`

Set command to execute. You can use the following markers:

 * \#s -> sender
 * \#m -> message
 * \#\# -> literal #


### Command Examples

#### Android notifications for Termux
You'll need [Termux:API](https://play.google.com/store/apps/details?id=com.termux.api) and the termux-api package (`apt install termux-api`).

```
/notifycmd command termux-notification -t "New message from #s" -c "#m";termux-vibrate
```
![Screenshot](screenshot.png)

#### Send an Email as a notification

```
/notifycmd plugin command set to: echo "#m" | mutt -s "New message from #s" <EMAIL>
```
<commit_msg>fix typos and mistakes in readme<commit_after># profanity-notifycmd
Plugin for Profanity to launch a custom shell command when a message is received



## Requirements



## Installation

1. Download the script

2. Launch Profanity

3. Install the plugin with the following command

```
/plugins install ~/profanity-notifycmd/notifycmd.py

```

## Configuration

### Turn the plugin on

`/notifycmd on`

### Turn the plugin off

`/notifycmd off`

### Only notify for the currently active window

`/notifycmd active`

### Enable/Disable notifications for all messages in rooms

`/notifycmd rooms on|off`

### Set command to exectue

`/notifycmd command <command>`

Set command to execute. You can use the following markers:

 * \#s -> sender
 * \#m -> message
 * \#\# -> literal #


### Command Examples

#### Android notifications for Termux
You'll need [Termux:API](https://play.google.com/store/apps/details?id=com.termux.api) and the termux-api package (`apt install termux-api`).

```
/notifycmd command termux-notification -t "Profanity: #s says:" -c "#m";termux-vibrate
```
![Screenshot](screenshot.png)

#### Send an Email as a notification

```
/notifycmd plugin command set to: echo "#m" | mutt -s "New message from #s" <EMAIL>
```

{'fraction_non_alphanumeric': 0.12941176470588237, 'fraction_numerical': 0.002434077079107505, 'mean_word_length': 4.1161825726141075, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3241890', 'n_tokens_mistral': 799, 'n_tokens_neox': 745, 'n_words': 276}