commit a9d7df0a1559f9e66ee40adc59a38a942d355bc3
parent 4b77465a28808e856ffe7913b519d78d095fdf36
Author: Byron Torres <b@torresjrjr>
Date: Fri, 29 Jan 2021 17:55:28 +0000
Minor refractor
Diffstat:
M | fetch | | | 15 | ++++++--------- |
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/fetch b/fetch
@@ -11,8 +11,8 @@ c3=$(printf '\e[33m'); c4=$(printf '\e[34m')
c5=$(printf '\e[35m'); c6=$(printf '\e[36m')
c7=$(printf '\e[37m'); c8=$(printf '\e[38m')
-reposition() { printf '\r\e[%sA' "${graphic_y}" ;}
-padding() { printf '\e[%sC' "${graphic_x}" ;}
+reposition() { printf '\e[%sA\r' "${graphic_y}" ;}
+padding() { printf '\e[%sC' "${graphic_x}" ;}
## Graphic
@@ -33,10 +33,6 @@ ${c2} ${b}${c0}
"
}
-palette() {
- printf "\e[7m$c1 $c2 $c3 $c4 $c5 $c6 \e[m\n"
-}
-
## Statuslines
@@ -45,8 +41,8 @@ _os() { printf "$1" "$(uname -o)" ;}
_kernel() { printf "$1" "$(uname -sr)" ;}
_shell() { printf "$1" "${SHELL}" ;}
_sshd() {
- sshd_pid=$(ps | awk 'BEGIN{ORS=" "}; /sshd/{print $1}')
- printf "$1" "${sshd_pid:---}"
+ sshd_pids=$(ps | awk 'BEGIN{ORS=" "}; /sshd/{print $1}')
+ printf "$1" "${sshd_pids:---}"
}
_tmux() {
if ps | grep tmux >/dev/null
@@ -63,6 +59,7 @@ _tmux() {
fi
printf "$1" "${tmux_sessions}"
}
+_palette() { printf "\e[7m$c1 $c2 $c3 $c4 $c5 $c6 \e[m\n" ;}
## Status
@@ -74,7 +71,7 @@ status() {
padding; _shell "${c6}shell: ${c0}%s\n"
padding; _sshd "${c6}sshd: ${c0}%s\n"
padding; _tmux "${c6}tmux: ${c0}%s\n"
-# padding; palette
+# padding; _palette
}