fetch

A MSYS2-compatible sys-info prompt
Log | Files | Refs | README | LICENSE

commit 0544f433058dfcb5957cf74bc144e8174a7d1221
parent b0e9f253160fa4a572e2e1a8fbbaed839d5af98f
Author: Byron Torres <b@torresjrjr.com>
Date:   Thu, 18 Feb 2021 04:14:18 +0000

Portability fixes for host, shell, and tmux

Diffstat:
Mfetch | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fetch b/fetch @@ -46,7 +46,7 @@ status() { ## Statuslines _title() { - printf "$1" "$(whoami)" "$(hostname)" "$(date -R)" + printf "$1" "$(whoami)" "$(uname -n)" "$(date -R)" } _os() { printf "$1" "$(uname -o)" @@ -55,14 +55,14 @@ _kernel() { printf "$1" "$(uname -sr)" } _shell() { - printf "$1" "$(< /proc/$(< /proc/$$/ppid)/exename)" + printf "$1" "$($(readlink /proc/$PPID/exe) --version | head -1)" } _sshd() { sshd_pids=$(ps | awk 'BEGIN{ORS=" "}; /sshd/{print $1}') printf "$1" "${sshd_pids:---}" } _tmux() { - ps | grep -q tmux && tmux_sessions=$( + ps a | grep -q tmux && tmux_sessions=$( tmux ls \ | sed \ -e 's/(created[^)]*)//' -e 's/(attached)/@/' \