Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/FMotalleb/nu_plugin_desktop_notifications

A nushell plugin to send notification to desktop using notify-rust
https://github.com/FMotalleb/nu_plugin_desktop_notifications

desktop-notifications notifications nushell-plugin

Last synced: 4 months ago
JSON representation

A nushell plugin to send notification to desktop using notify-rust

Lists

README

        

# nu_plugin_desktop_notifications

A [nushell](https://www.nushell.sh/) plugin to send notification to desktop using [notify-rust](https://github.com/hoodie/notify-rust)

# Examples

```bash
Flags:
-h, --help - Display the help message for this command
-s, --summary - summary of the notification
-t, --body - body of the notification
--subtitle - subtitle of the notification [macOS and windows only]
-a, --app-name - app name of the notification
-i, --icon - path to icon of the notification
--timeout - duration of the notification [macOS and XDG Desktops only] (defaults to system default)
--crash-on-error - returns notification error if encountered
```

```bash
~> notify -t "test notification body" --summary "test title"
```

* send a notification after doing a task and display the time in the notification

![image](https://github.com/FMotalleb/nu_plugin_desktop_notifications/assets/30149519/a4fbc2a9-6537-4d18-8d98-e55ebcd6b0bd)

```bash
def "notify on done" [
task: closure
] {
let start = date now
let result = do $task
let end = date now
let total = $end - $start | format duration sec
let body = $"given task finished in ($total)"
notify -s "task is done" -t $body
return $result
}

notify on done { port scan 8.8.8.8 53 }
```

# Installing

* using [nupm](https://github.com/nushell/nupm)

```bash
git clone https://github.com/FMotalleb/nu_plugin_desktop_notifications.git
nupm install --path nu_plugin_desktop_notifications -f
```

* or compile manually

```bash
git clone https://github.com/FMotalleb/nu_plugin_desktop_notifications.git
cd nu_plugin_desktop_notifications
cargo build -r
register target/release/nu_plugin_desktop_notifications
```

* or using cargo

```bash
cargo install nu_plugin_desktop_notifications
register ~/.cargo/bin/nu_plugin_desktop_notifications
```