Skip to content
/ hark Public

Announce when your long running commands finally finish!

Notifications You must be signed in to change notification settings

ErisMik/hark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hark!

Announce when your long running command has finished!

Features

100% Rust
Powered by ntfy.sh for recieving notifications on the go
Support for most platforms
Automatiaclly times commands
Can monitor already started processes
Get updated on the ETA, status and more! (coming soon)
Miniscule overhead

Usage

Usage: hark [OPTIONS] <CMD>...

Arguments:
  <CMD>...  Command and arguments to be run

Options:
  -v, --verbose        Print verbose output
  -t, --topic <TOPIC>  ntfy.sh topic to publish notification to
  -c, --config <FILE>  Sets a custom config file path [default: /etc/hark.toml]
  -s, --save           Save command line settings to config file
  -p, --process <PID>  PID of the process to monitor
  -h, --help           Print help
  -V, --version        Print version

ntfy.sh

Before being able to use hark, you'll need to set yourself up with ntf.sh. Download the app, and then create a topic to use here. Pass it in using -t or save it to a config file.

Examples

Use hark to time and launch a command:

hark rsync -a really/large/dir/ another/dir/

Your notification will be something like:

"rsync" finished with success after 45.32m (January 8, 20201 at 9:30pm)

You can use it to attach to an existing process by the processes PID:

hark -p 2077

Your notification will be something like:

"rsync" (PID 2077) finished with status "47" after 45.32m (January 8, 20201 at 9:30pm)

You can use it without any arguments, where hark will just send a notification right away:

dd if=/dev/zero of=/dev/sda1 bs=1M; hark

Your notification will be something like:

Command finished (January 8, 20201 at 9:30pm)

Config

You can use the configuration file to store your ntfy.sh topic, so you don't need to input it everytime you run the command. Configuration files can be given in any of the following formats: JSON, YAML, TOML, HJSON.

An example .toml file would look like this:

topic = "my-topic-here"

By default hark will look for a configuration file at /etc/hark.toml. This file can be changed via the command line options. If the specified or default configuration file is not found, hark will look for a configuration file in the current directory with the name hark.* where * is any of the supported configuration types.

Build

First install Rust (recommended using rustup).

$ git clone https://github.com/erismik/hark.git
$ cd hark
$ cargo build --release

Install

Using cargo,

$ cargo install --path .

Contributions

Suggestions, issues, and pull requests are welcome!

About

Announce when your long running commands finally finish!

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages