ntfy icon indicating copy to clipboard operation
ntfy copied to clipboard

Feature Request: Support for piping in stdin

Open SteveEdson opened this issue 8 years ago • 6 comments

It'd be great if we could pipe output into ntfy, and send it with the notification

E.g. $ fortune | ntfy

This way, when commands finish, we can get the output directly in the notification.

SteveEdson avatar Aug 31 '16 22:08 SteveEdson

Any reason ntfy send "$(fortune)" isn't sufficient?

dschep avatar Aug 31 '16 22:08 dschep

Didn't think of that, but just for convenience and keeping things standard. If a command takes longer than expected, I'm more likely to press up and append the pipe, than having to wrap it all with the command above

SteveEdson avatar Aug 31 '16 22:08 SteveEdson

To add to this, piping makes it very difficult to grab the exit code of the previous pipe item so you wouldn't be able to gather success or failure in a nice cross-platform way.

AndrewGuenther avatar Jan 30 '17 15:01 AndrewGuenther

Any reason ntfy send "$(fortune)" isn't sufficient?

I think it would be nice to show this functionality in ntfy's github homepage. I believe some people are actually looking for this.

hulinghuan avatar Oct 20 '17 23:10 hulinghuan

I have a command I'd like to run and conditionally send the output based on the exit code. It seemed natural and unixy to just ntfy send < myfile and I was a bit surprised there was no way to do this.

dustin avatar Jul 14 '19 05:07 dustin

@dustin i'd happily accept a PR adding that. I would've accepted #104 with a minor change(making it be on ntfy send - like many other tools) but the author just closed it instead 🤷‍♂

dschep avatar Jul 17 '19 17:07 dschep