fetch

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

commit 9899b1e0ea1441be0175f983c35b7b5e9f237a8d
parent e1fac38b002008d593060fce2e229f82febaed11
Author: Byron Torres <b@torresjrjr.com>
Date:   Fri, 15 Oct 2021 00:55:09 +0100

Use env printf

Diffstat:
Mfetch | 18+++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/fetch b/fetch @@ -44,30 +44,30 @@ status() { ## Statuslines _title() { - printf "$1" "$(whoami)" "$(uname -n)" "$(date -R)" + env printf "$1" "$(whoami)" "$(uname -n)" "$(date -R)" } _os() { - printf "$1" "$(uname -o)" + env printf "$1" "$(uname -o)" } _kernel() { - printf "$1" "$(uname -sr)" + env printf "$1" "$(uname -sr)" } _shell() { - printf "$1" "$(readlink /proc/$PPID/exe)" + env printf "$1" "$(readlink /proc/$PPID/exe)" } _sshd() { pids=$(ps ax | awk '/sshd[^@]*@pts/ || /sshd$/ {printf $NF " "}') - printf "$1" "${pids:---}" + env printf "$1" "${pids:---}" } _tmux() { ps ax | grep -v 'grep' | grep -q 'tmux' && tmux_sessions=$( tmux ls -F "#{session_created} #{?session_attached,$ul,}#S:#{session_windows}$c0" \ | sort | awk '{printf $2 " "}' | xargs -0 printf ) - printf "$1" "${tmux_sessions:---}" + env printf "$1" "${tmux_sessions:---}" } _palette() { - printf "$rv$c1 $c2 $c3 $c4 $c5 $c6 $c0\n" + env printf "$rv$c1 $c2 $c3 $c4 $c5 $c6 $c0\n" } @@ -102,8 +102,8 @@ formatters() { ## Cursor util -reposition() { printf '\e[%sA\r' "$graphic_y" ;} -padding() { printf '\e[%sC' "$graphic_x" ;} +reposition() { env printf '\e[%sA\r' "$graphic_y" ;} +padding() { env printf '\e[%sC' "$graphic_x" ;} ## Run