home
/
code
/
khome.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
921bf32
)
Simplify tmux status reporting
author
Siraaj Khandkar
<siraaj@khandkar.net>
Wed, 12 Oct 2022 17:54:33 +0000
(13:54 -0400)
committer
Siraaj Khandkar
<siraaj@khandkar.net>
Wed, 12 Oct 2022 17:54:33 +0000
(13:54 -0400)
home/lib/login_functions.sh
patch
|
blob
|
blame
|
history
diff --git
a/home/lib/login_functions.sh
b/home/lib/login_functions.sh
index
b6dd8a6
..
a691958
100644
(file)
--- a/
home/lib/login_functions.sh
+++ b/
home/lib/login_functions.sh
@@
-674,7
+674,7
@@
status() {
echo 'accounting'
echo 'accounting'
- printf '%stmux
(s->c)
\n' "$indent_unit"
+ printf '%stmux\n' "$indent_unit"
ps -eo comm,cmd \
| awk '
# Expecting lines like:
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) {
split(sides_of_L[2], words_right_of_L, FS)
sock=words_right_of_L[1]
if (!sock) {
- sock = "
anon
"
+ sock = "
default
"
} else {
} else {
- sock = "
named." sock
+ sock = "
\"" sock "\""
}
roles[role]++
socks[sock]++
}
roles[role]++
socks[sock]++
@@
-699,15
+699,13
@@
status() {
}
END {
}
END {
- sock_sep = ""
for (sock in socks) {
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"
}' \
}
printf "\n"
}' \
This page took
0.020048 seconds
and
4
git commands to generate.