Created
December 30, 2020 20:27
-
-
Save chregon/f8b567bdc6808415bac86cbfa02af162 to your computer and use it in GitHub Desktop.
tiramisu -> herbe through unix named pipe
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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