fetch

MSYS2-compatible system info prompt
git clone https://git.torresjrjr.com/fetch.git
Log | Files | Refs | README | LICENSE

commit e1fac38b002008d593060fce2e229f82febaed11
parent 5d20b4a9ac4868f8b56270f0c654932d274cc79f
Author: Byron Torres <b@torresjrjr.com>
Date:   Thu, 26 Aug 2021 00:56:15 +0100

Improve _sshd() using 'user@pts/n' output from ps

Diffstat:
MREADME.md | 6+++---
Mfetch | 2+-
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/README.md b/README.md @@ -8,7 +8,7 @@ Originally for [MSYS2][1] on Windows, compatible with UNIX-likes. .-. os Msys /`v`\ kernel MSYS_NT-10.0-19042 3.1.7-340.x86_64 (/ \) shell /usr/bin/bash - ====="="===< sshd 266 41764 41768 + ====="="===< sshd user@pts/4 user@pts/12 |_| tmux meh:4 astro:2 gmni:1 comm:2 Overwrite functions locally at `$XDG_CONFIG_HOME/fetch/config.sh`. @@ -19,9 +19,9 @@ Overwrite functions locally at `$XDG_CONFIG_HOME/fetch/config.sh`. env printf "${c4}%s\n" \ ' . ' \ ' / \ ' \ - ' / \ ' \ + ' /\ \ ' \ ' / \ ' \ - ' / .-. \ ' \ + ' / .-. `\ ' \ ' /.- `-.\ ' } diff --git a/fetch b/fetch @@ -56,7 +56,7 @@ _shell() { printf "$1" "$(readlink /proc/$PPID/exe)" } _sshd() { - pids=$(ps ax | awk '!/awk/ && /sshd/ {printf $1 " "}') + pids=$(ps ax | awk '/sshd[^@]*@pts/ || /sshd$/ {printf $NF " "}') printf "$1" "${pids:---}" } _tmux() {