Skip to content

Instantly share code, notes, and snippets.

@chregon
Created December 30, 2020 20:27
Show Gist options
  • Save chregon/f8b567bdc6808415bac86cbfa02af162 to your computer and use it in GitHub Desktop.
Save chregon/f8b567bdc6808415bac86cbfa02af162 to your computer and use it in GitHub Desktop.
tiramisu -> herbe through unix named pipe
#!/usr/bin/env bash
pipe=notifications
trap "rm -f $pipe" EXIT
if [[ ! -p $pipe ]]; then
mkfifo $pipe
fi
tiramisu -j > $pipe &
while true
do
if read line <$pipe; then
if [[ "$line" == 'quit' ]]; then
break
fi
herbe "$(echo $line | jq ".app_name" -r | figlet -f small )" "::$(echo $line | jq ".summary" -r)::" " " "$(echo $line | jq ".body" -r)"
fi
done
echo "Reader exiting"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment