commit b2246e19572f347b14709d4b28768fc586fdfb13
parent d475f886dbeb97365f22d03bab19d48dc4770eb0
Author: Cem Keylan <cem@ckyln.com>
Date: Fri, 8 May 2020 00:05:29 +0300
yaic: add notetaking function
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/yaic b/yaic
@@ -39,6 +39,7 @@ gethelp() {
":h|:help Prints this help information" \
":hist Changes the history size" \
":m Marks the current position" \
+ ":n [note] Adds a note to the current position" \
":s Toggles server notifications" \
":t Toggles outputting your own messages" \
":q Exits the program (not ii)" \
@@ -181,6 +182,7 @@ main() {
# Server messages are printed grey to be not distracting.
case "$auth" in
"$n") printf '%s \033[1;33m%-10.*s \033[m' "$cleardate" "$l" "$auth" ;;
+ "NOTE")printf '%s \033[1;31m%-10.*s \033[m' "$cleardate" "$l" "$auth" ;;
"-!-") printf '\033[37m%s %-10.*s ' "$cleardate" "$l" "$auth"; ;;
"$ss") printf '%s %-10.*s ' "$cleardate" "$l" "$auth" ;;
*) printf '%s \033[1;36m%-10.*s \033[m' "$cleardate" "$l" "$auth"
@@ -253,6 +255,7 @@ main() {
h="${msg#:hist* }" CHAN="${c:-.}" ; break ;;
:q) break ;;
:t) toggle NOTEXT ; [ "$NOTEXT" ] && stty -echo || stty echo ; continue ;;
+ ":n "*) printf '%s <NOTE> %s\n' "$(date +%s)" "${msg#:n }" >> "$outfile" ; continue ;;
:m) mark; continue ;;
:x) mark; break ;;
:s) toggle NOSERVER ; CHAN="${c:-.}" ; break ;;