We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 64eb09c commit 216f6f0Copy full SHA for 216f6f0
smuxi_hooks/on-message-received/print_msg.sh
@@ -11,15 +11,14 @@ if [ "$SMUXI_CHAT_ID" != "#dimsumlabs" ]; then
11
exit 0
12
fi
13
14
-# Sends ESC/P command
15
-send_esc() {
16
- echo -en "\x1b$1" | lpr
17
-}
18
-
19
-echo -n "$SMUXI_MSG_TIMESTAMP_ISO_LOCAL " | lpr
20
-send_esc 4 # Select italic
21
-echo -n "$SMUXI_SENDER " | lpr
22
-send_esc 5 # Cancel italic
23
-echo $SMUXI_MSG \
24
- | iconv -f utf-8 -t 437 -c \
25
- | lpr &
+ESC="\x1b"
+ITALIC_ON="${ESC}4"
+ITALIC_OFF="${ESC}5"
+(
+ echo -n "$SMUXI_MSG_TIMESTAMP_ISO_LOCAL "
+ echo -ne "$ITALIC_ON"
+ echo -n "$SMUXI_SENDER"
+ echo -ne "$ITALIC_OFF"
+ echo " $SMUXI_MSG"
+) | iconv -f utf-8 -t 437 -c \
+ | lpr &
0 commit comments