Use my $DISPLAY_NAME and $MXID in my messages as a signature.

This commit is contained in:
Jordan Bancino 2022-08-12 22:01:27 -04:00
parent 1d0fb32155
commit 3bda6b89bb

View file

@ -8,6 +8,14 @@ if [ -f "$(pwd)/.env" ]; then
. "$(pwd)/.env" . "$(pwd)/.env"
fi fi
if [ -z "$MXID" ]; then
MXID="@(${USER}:$(hostname)"
fi
if [ -z "$DISPLAY_NAME" ]; then
DISPLAY_NAME=$(getent passwd "$USER" | cut -d ':' -f 5 | cut -d ',' -f 1)
fi
if [ -z "$TELODENDRIA_PUB" ]; then if [ -z "$TELODENDRIA_PUB" ]; then
echo "TELODENDRIA_PUB not set." echo "TELODENDRIA_PUB not set."
exit 1 exit 1
@ -107,7 +115,7 @@ case "$1" in
msgFile="/tmp/patchmsg-$(date +%s).txt" msgFile="/tmp/patchmsg-$(date +%s).txt"
$EDITOR "$msgFile" $EDITOR "$msgFile"
if [ -f "$msgFile" ]; then if [ -f "$msgFile" ]; then
msg="$msg<br><blockquote>$(cat $msgFile)</blockquote>" msg="$msg<br><blockquote>$(cat $msgFile)<br>&mdash;$DISPLAY_NAME ($MXID)</blockquote>"
fi fi
matrix_send "$msg" matrix_send "$msg"
else else