Use xargs
to effectively pass something in arguments, allows more independent execution to add more arguments and configuration for notify-send
.
[command] 2>&1 | xargs -I {} notify-send "{}"
Example: ls "i don't exists" 2>&1 | xargs -I {} notify-send "{}"