#nushell #desktop #notification #plugin

app nu_plugin_desktop_notifications

A nushell plugin to send desktop notifications

5 releases (3 stable)

1.0.8 Feb 12, 2024
1.0.1 Nov 13, 2023
1.0.0 Nov 8, 2023
0.1.1 Nov 8, 2023
0.1.0 Nov 8, 2023

#89 in GUI

Download history 63/week @ 2023-11-05 33/week @ 2023-11-12 9/week @ 2023-11-19 11/week @ 2023-11-26 20/week @ 2023-12-03 1/week @ 2023-12-10 6/week @ 2023-12-17 8/week @ 2023-12-24 4/week @ 2023-12-31 7/week @ 2024-01-07 2/week @ 2024-01-14 3/week @ 2024-01-21 9/week @ 2024-01-28 8/week @ 2024-02-04 73/week @ 2024-02-11

93 downloads per month

MIT and maybe CC-PDDC

22KB
114 lines

nu_plugin_desktop_notifications

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

Examples

Flags:
  -h, --help - Display the help message for this command
  -s, --summary <String> - summary of the notification
  -t, --body <String> - body of the notification
  --subtitle <String> - subtitle of the notification [macOS and windows only]
  -a, --app-name <String> - app name of the notification
  -i, --icon <Filepath> - path to icon of the notification
  --timeout <Duration> - duration of the notification [macOS and XDG Desktops only] (defaults to system default)
  --crash-on-error <Filepath> - returns notification error if encountered
~> notify -t "test notification body" --summary "test title"
  • send a notification after doing a task and display the time in the notification

image

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

git clone https://github.com/FMotalleb/nu_plugin_desktop_notifications.git
nupm install --path nu_plugin_desktop_notifications -f
  • or compile manually
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
cargo install nu_plugin_desktop_notifications
register ~/.cargo/bin/nu_plugin_desktop_notifications

Dependencies

~13–50MB
~759K SLoC