forked from lda/telodendria
Use my $DISPLAY_NAME and $MXID in my messages as a signature.
This commit is contained in:
parent
1d0fb32155
commit
3bda6b89bb
1 changed files with 9 additions and 1 deletions
10
tools/bin/tp
10
tools/bin/tp
|
@ -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>—$DISPLAY_NAME ($MXID)</blockquote>"
|
||||||
fi
|
fi
|
||||||
matrix_send "$msg"
|
matrix_send "$msg"
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue