#!/bin/bash # # requiere sqlite3 y gajim # JID=video_3361@salas.xmpp.fediverse.tv while [ 1 ]; do echo "SELECT contact_name, message from logs WHERE jid_id = $(echo "SELECT jid_id FROM jids WHERE jid=\"$JID\";" | sqlite3 ~/.local/share/gajim/logs.db);" \ | sqlite3 ~/.local/share/gajim/logs.db \ | head -n 15 | sed 's/|/: /g'| fold -sw 60 > /tmp/chat.txt sleep 5 done # jids table has jid and jid_id # logs table has log_id, jid_id, contact_name, time, kind, show, message # so to ask logs we need jid_id that matches our jid in jids table # this method asks jid and returns the jid_id for later sql-ing on logs # https://dev.gajim.org/gajim/gajim/-/wikis/help/DatabaseScripts