t0mri@lemmy.ml to Linux@lemmy.ml · 10 days agohook sh script to libnotifymessage-squaremessage-square3fedilinkarrow-up119arrow-down13file-text
arrow-up116arrow-down1message-squarehook sh script to libnotifyt0mri@lemmy.ml to Linux@lemmy.ml · 10 days agomessage-square3fedilinkfile-text
minus-squarejacky@sopuli.xyzlinkfedilinkarrow-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
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