jacky

joined 2 years ago
[–] jacky@sopuli.xyz 0 points 11 months ago (1 children)

tiramisu sends notification to stdout, so you can write a wrapper around it to call any program or script you want.

e.g. (using herbe to display notifications):

#!/bin/bash
buf=''
/usr/bin/tiramisu -j | while read -r line; do
        buf="${buf}${line}"
        jq -e <<< "${buf}"
        if [[ $? -ne 4 ]]; then
                /usr/bin/herbe "$(/usr/bin/jq -cMr '.summary' <<< "$buf")" "$(/usr/bin/jq -cMr '.body' <<< "$buf")"
                buf=''
        else
                buf="${buf}\\n"
        fi
done