#!/bin/sh # MIT License # # Copyright (c) 2022 gentoo-btw # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. # colors for tty sessions if [ "$TERM" = "linux" ]; then BLK='\033[0;30m' RED='\033[0;31m' GRN='\033[1;32m' YEL='\033[1;33m' BLU='\033[0;34m' PURP='\033[0;35m' CYN='\033[0;36m' WHT='\033[0;37m' else # colors for gui BLK='\033[0;30m' RED='\033[0;31m' GRN='\033[2;32m' YEL='\033[0;33m' BLU='\033[0;34m' PURP='\033[0;35m' CYN='\033[0;36m' WHT='\033[0;37m' fi # blue arrow BLUE_ARROW="$(printf "%b->%b" "${BLU}" "${WHT}")" # sets version RAMFETCH_VER="v1.0.2" # help and version if [ "$*" = "--help" ] || [ "$*" = "-h" ]; then cat <%b" "${GRN}" "${WHT}")" HOSTNAME="$(hostname)" HOST_AND_USER_LEN=$(echo ${#HOSTNAME} + ${#USER} + 1 | bc) HOST_AND_USER="$(printf "%b%s%b%c%b%s%b" "${GRN}" "$USER" "${WHT}" "@" "${YEL}" "$HOSTNAME" "${WHT}")" COLORBLOCKS="$(printf "%b%s%b%s%b%s%b%s%b%s%b%s%b%s%b%s%b" "${BLK}" "███" "${RED}" "███" "${GRN}" "███" "${BLU}" "███" "${YEL}" "███" "${PURP}" "███" "${CYN}" "███" "${WHT}" "███" "${WHT}")" # for ascii logo YELLOW_PART="$(printf "%b" "${YEL}")" GREEN_PART="$(printf "%b" "${GRN}")" END="$(printf "%b" "${WHT}")" # output cat <