minus-squarejackytoLinux@lemmy.ml•hook sh script to libnotifylinkfedilinkarrow-up0·4 days agotiramisu 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 linkfedilink
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