~torresjrjr/fetch

9899b1e0ea1441be0175f983c35b7b5e9f237a8d — Byron Torres 7 months ago e1fac38
Use env printf
1 files changed, 9 insertions(+), 9 deletions(-)

M fetch
M fetch => fetch +9 -9
@@ 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