From: Siraaj Khandkar Date: Wed, 12 Oct 2022 17:54:33 +0000 (-0400) Subject: Simplify tmux status reporting X-Git-Url: https://git.xandkar.net/?p=khome.git;a=commitdiff_plain;h=549b689caf4f12615520e6558b011ffbaf2bad09 Simplify tmux status reporting --- diff --git a/home/lib/login_functions.sh b/home/lib/login_functions.sh index b6dd8a6..a691958 100644 --- a/home/lib/login_functions.sh +++ b/home/lib/login_functions.sh @@ -674,7 +674,7 @@ status() { echo 'accounting' - printf '%stmux (s->c)\n' "$indent_unit" + printf '%stmux\n' "$indent_unit" ps -eo comm,cmd \ | awk ' # Expecting lines like: @@ -689,9 +689,9 @@ status() { split(sides_of_L[2], words_right_of_L, FS) sock=words_right_of_L[1] if (!sock) { - sock = "anon" + sock = "default" } else { - sock = "named." sock + sock = "\"" sock "\"" } roles[role]++ socks[sock]++ @@ -699,15 +699,13 @@ status() { } END { - sock_sep = "" for (sock in socks) { - printf "%s%s ", sock_sep, sock - sock_sep = "\n" - role_sep = "" - for (role in roles) { - printf "%s%d", role_sep, count[role, sock] - role_sep = "->" + clients = count["client", sock] + printf "%s ", sock + if (clients) { + printf "<-> %d", clients } + printf "\n" } printf "\n" }' \