Add sh-compatibility, clean up a little.

This commit is contained in:
jschx committed 2015-04-13 17:22:18 -05:00
1 parent f80926d4b3
commit fda5e2eb52
1 file changed
+13 -14
+13 -14
View File
@@ -1,4 +1,4 @@
#!/bin/bash #!/bin/sh
# #
# ufetch - tiny system info for crux # ufetch - tiny system info for crux
# #
@@ -6,17 +6,17 @@
## INFO ## INFO
# user is already defined # user is already defined
# hostname is already defined HOST=$(hostname)
OS=$(crux) OS=$(crux)
KERNEL=$(uname -rs) KERNEL=$(uname -sr)
UPTIME=$(uptime -p | sed s:"up ":"":) UPTIME=$(uptime -p | sed s:"up "::)
PACKAGES=$(pkginfo -i | wc -l) PACKAGES=$(pkginfo -i | wc -l)
# shell is already defined # shell is already defined
WM=$(tail -n 1 "$HOME/.xinitrc" | cut -d " " -f2) WM=$(tail -n 1 "$HOME/.xinitrc" | cut -d " " -f2)
## DEFINE COLORS ## DEFINE COLORS
rc=$(tput sgr0) # reset bc=$(tput bold) # bold
c0=$(tput setaf 0) # black c0=$(tput setaf 0) # black
c1=$(tput setaf 1) # red c1=$(tput setaf 1) # red
c2=$(tput setaf 2) # green c2=$(tput setaf 2) # green
@@ -25,19 +25,18 @@ c4=$(tput setaf 4) # blue
c5=$(tput setaf 5) # magenta c5=$(tput setaf 5) # magenta
c6=$(tput setaf 6) # cyan c6=$(tput setaf 6) # cyan
c7=$(tput setaf 7) # white c7=$(tput setaf 7) # white
bc=$(tput bold) # bold rc=$(tput sgr0) # reset
## OUTPUT ## OUTPUT
# todo: make good
cat <<EOF cat <<EOF
${c6} ___ ${bc}${USER}${c7}@${c6}${HOSTNAME}${rc} ${c6} ___ ${bc}${USER}${c7}@${c6}${HOST}${rc}
${c6} (${c7}.· ${c6}| ${bc}OS: ${c7}${OS}${rc} ${c6} (${c7}.· ${c6}| ${bc}OS: ${c7}${OS}${rc}
${c6} (${c3}<> ${c6}| ${bc}KERNEL: ${c7}${KERNEL}${rc} ${c6} (${c3}<> ${c6}| ${bc}KERNEL: ${c7}${KERNEL}${rc}
${c6} / ${c7}__ ${c6}\\ ${bc}UPTIME: ${c7}${UPTIME}${rc} ${c6} / ${c7}__ ${c6}\\ ${bc}UPTIME: ${c7}${UPTIME}${rc}
${c6} ( ${c7}/ \ ${c6}/| ${bc}PACKAGES: ${c7}${PACKAGES}${rc} ${c6} ( ${c7}/ \ ${c6}/| ${bc}PACKAGES: ${c7}${PACKAGES}${rc}
${c3} _${c6}/\ ${c7}__)${c6}/${c3}_${c6}) ${bc}SHELL: ${c7}${SHELL}${rc} ${c3} _${c6}/\ ${c7}__)${c6}/${c3}_${c6}) ${bc}SHELL: ${c7}${SHELL}${rc}
${c3} \/${c6}-____${c3}\/ ${c6}${bc}WM: ${c7}${WM}${rc} ${c3} \/${c6}-____${c3}\/ ${c6}${bc}WM: ${c7}${WM}${rc}
EOF EOF