From 3bda6b89bb6451f225a87a5573a255cec3e86675 Mon Sep 17 00:00:00 2001 From: Jordan Bancino Date: Fri, 12 Aug 2022 22:01:27 -0400 Subject: [PATCH] Use my $DISPLAY_NAME and $MXID in my messages as a signature. --- tools/bin/tp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/bin/tp b/tools/bin/tp index c553346..c6a6590 100755 --- a/tools/bin/tp +++ b/tools/bin/tp @@ -8,6 +8,14 @@ if [ -f "$(pwd)/.env" ]; then . "$(pwd)/.env" 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 echo "TELODENDRIA_PUB not set." exit 1 @@ -107,7 +115,7 @@ case "$1" in msgFile="/tmp/patchmsg-$(date +%s).txt" $EDITOR "$msgFile" if [ -f "$msgFile" ]; then - msg="$msg
$(cat $msgFile)
" + msg="$msg
$(cat $msgFile)
—$DISPLAY_NAME ($MXID)
" fi matrix_send "$msg" else