@t0mri@lemmy.ml to Linux@lemmy.ml • 3 months agohook sh script to libnotifymessage-square4fedilinkarrow-up120arrow-down13file-text
arrow-up117arrow-down1message-squarehook sh script to libnotify@t0mri@lemmy.ml to Linux@lemmy.ml • 3 months agomessage-square4fedilinkfile-text
minus-squarejackylinkfedilink0•2 months 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
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
finally! thank you