From 13629d9425bd16a13a0c7cd03da3213ae3e3ede6 Mon Sep 17 00:00:00 2001 From: Shipwreckt Date: Wed, 24 Jan 2024 17:20:35 +0000 Subject: Added the ability to use variables instead of something like MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Term → ${YELLOW}${TERMINAL}${RESET}" it has been simplified by $(get_terminal_info)${RESET}" --- fakefetch.sh | 160 ++++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 98 insertions(+), 62 deletions(-) (limited to 'fakefetch.sh') diff --git a/fakefetch.sh b/fakefetch.sh index d64f50d..48d058c 100644 --- a/fakefetch.sh +++ b/fakefetch.sh @@ -45,12 +45,20 @@ HOSTNAME=$(uname -n) #sudo apt-get install lsb-release DISTRO=$(lsb_release -sd | sed 's/"//g') -#DISTRO=$(lsb_release -si) + +get_distro_info() { + echo "OS → ${YELLOW}${DISTRO}${RESET}" +} + #What cpu CPU_INFO=$(lscpu | grep 'Model name' | awk '{$1=$2=""; print $0}' | sed 's/^[ \t]*//') CORES=$(lscpu | grep 'Core(s) per socket' | awk '{print $NF}') +get_cpu_info() { + echo "CPU → ${YELLOW}${CPU_INFO} (${CORES})" +} + #What Gpu you are using get_gpu_info() { local gpu_info @@ -58,11 +66,40 @@ get_gpu_info() { echo "$gpu_info" } GPU_INFO=$(get_gpu_info) +get_gpu_info() { + echo "GPU → ${YELLOW}${GPU_INFO}" +} + +#uptime +UPTIME=$(uptime -p | sed 's/up //') +get_uptime() { + local uptime_output=$(uptime -p) + echo "Uptime → ${YELLOW}${uptime_output:-Unknown}${RESET}" +} + #You do need to set this manually TERMINAL="Alacritty" +get_terminal_info() { + echo "Term → ${YELLOW}${TERMINAL}" +} +# Detect Package Manager +package_manager() { + if command -v pacman &> /dev/null; then + echo "PM → ${YELLOW}Pacman${RESET}" + elif command -v apt-get &> /dev/null; then + echo "PM → ${YELLOW}APT${RESET}" + # Add more package manager checks if needed + else + echo "PM → ${YELLOW}Unknown${RESET}" + fi +} +#----------------------------------------------------------------------------------# +# Decoration variables # +#----------------------------------------------------------------------------------# +LINE="======================================================" #----------------------------------------------------------------------------------# # Art # #----------------------------------------------------------------------------------# @@ -73,79 +110,78 @@ TERMINAL="Alacritty" # Small Tux # #echo -e "${PURPLE} .--. ${USERNAME}@${HOSTNAME}${RESET}" -#echo -e "${PURPLE} |o_o | ======================================================${RESET}" -#echo -e "${PURPLE} |:_/ | OS → ${YELLOW}${DISTRO}${RESET}" -#echo -e "${PURPLE} // \\ \ Cpu → ${YELLOW}${CPU_INFO} (${CORES})${RESET}" -#echo -e "${PURPLE} (| | ) Gpu → ${YELLOW}${GPU_INFO}${RESET}" -#echo -e "${PURPLE} /'\\_ _/ \ Term → ${YELLOW}${TERMINAL}${RESET}" -#echo -e "${PURPLE} \\___)=(___/ ======================================================${RESET}" +#echo -e "${PURPLE} |o_o | ${LINE}${RESET}" +#echo -e "${PURPLE} |:_/ | $(get_distro_info)${RESET}" +#echo -e "${PURPLE} // \\ \ $(get_cpu_info)${RESET}" +#echo -e "${PURPLE} (| | ) $(get_gpu_info)${RESET}" +#echo -e "${PURPLE} /'\\_ _/ \ $(get_terminal_info)${RESET}" +#echo -e "${PURPLE} \\___)=(___/ ${LINE}${RESET}" #----------------------------------------------------------------------------------# # cowsay # #echo -e "${PURPLE} ________________________________________ " #echo -e "${PURPLE} / \ ${USERNAME}@${HOSTNAME}${RESET}" -#echo -e "${PURPLE} \ / ======================================================${RESET}" -#echo -e "${PURPLE} ---------------------------------------- OS → ${YELLOW}${DISTRO}${RESET}" -#echo -e "${PURPLE} \ ^__^ Cpu → ${YELLOW}${CPU_INFO} (${CORES})${RESET}" -#echo -e "${PURPLE} \ (oo)\_______ Gpu → ${YELLOW}${GPU_INFO}${RESET}" -#echo -e "${PURPLE} (__)\ )\/\ Term → ${YELLOW}${TERMINAL}${RESET}" -#echo -e "${PURPLE} ||----w | ======================================================${RESET}" -#echo -e "${PURPLE} || || " - +#echo -e "${PURPLE} \ / ${LINE}${RESET}" +#echo -e "${PURPLE} ---------------------------------------- $(get_distro_info)${RESET}" +#echo -e "${PURPLE} \ ^__^ $(get_cpu_info)${RESET}" +#echo -e "${PURPLE} \ (oo)\_______ $(get_gpu_info)${RESET}" +#echo -e "${PURPLE} (__)\ )\/\ $(package_manager)${RESET}" +#echo -e "${PURPLE} ||----w | $(get_terminal_info)${RESET}" +#echo -e "${PURPLE} || || $(get_uptime)${RESET}" +#echo -e "${PURPLE} ${LINE}${RESET}" #----------------------------------------------------------------------------------# # GNU # -#echo -e "${PURPLE} = ÷÷÷÷÷÷÷ × ÷÷÷÷÷ " -#echo -e "${PURPLE} ÷÷÷ ÷÷÷÷÷÷÷÷÷ ÷÷÷÷÷×÷÷÷ ÷÷ " -#echo -e "${PURPLE} ÷÷ ÷ ÷ ÷ " -#echo -e "${PURPLE} ÷÷π ÷ ∞÷÷÷÷ ÷ ÷÷÷ ÷ ÷÷ " -#echo -e "${PURPLE} ÷÷ ÷ ÷÷ ÷ ÷÷× ÷ ÷÷ " -#echo -e "${PURPLE} ∞÷÷ ÷ ÷ ÷÷÷÷÷ ÷∞ ÷÷÷ " -#echo -e "${PURPLE} ÷÷ ÷ ÷÷ ÷÷ ÷÷÷ ÷÷ ÷ ÷ ÷÷≠ ${USERNAME}@${HOSTNAME}${RESET}" -#echo -e "${PURPLE} ≈÷÷ ÷÷ ≠÷÷ ÷÷÷÷÷÷ ÷÷÷√÷÷÷ ÷÷÷√÷÷÷ ÷÷ ÷ ÷÷ ======================================================${RESET}" -#echo -e "${PURPLE} ÷ ÷ ÷÷÷÷÷÷π÷÷÷÷ ÷÷ ÷÷÷ ÷÷÷÷÷÷ ÷÷× OS → ${YELLOW}${DISTRO}${RESET}" -#echo -e "${PURPLE} ÷÷ ÷÷÷÷÷÷÷÷÷÷÷ ÷÷÷÷÷ ÷÷÷÷÷ ≠÷÷÷ Cpu → ${YELLOW}${CPU_INFO} (${CORES})${RESET}" -#echo -e "${PURPLE} ÷÷÷ ÷÷÷÷÷÷÷÷÷÷÷ ÷ ÷÷÷÷÷÷÷ ÷ ÷÷÷÷÷÷ ÷÷÷÷ Gpu → ${YELLOW}${GPU_INFO}${RESET}" -#echo -e "${PURPLE} ÷ ÷÷÷÷÷÷÷÷ ÷÷÷×÷÷÷÷÷÷÷÷÷÷÷÷ ÷÷÷÷÷÷ Term → ${YELLOW}${TERMINAL}${RESET}" -#echo -e "${PURPLE} ÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷ ÷ ÷÷÷= ======================================================${RESET}" -#echo -e "${PURPLE} ÷÷÷÷÷÷= ÷÷÷÷÷÷÷÷÷÷ ÷÷÷÷ ÷÷÷÷÷≠ " -#echo -e "${PURPLE} ÷÷÷ ÷÷÷÷÷÷ ÷÷÷÷÷ ∞π÷÷÷÷÷÷÷÷ " -#echo -e "${PURPLE} ÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷ " -#echo -e "${PURPLE} ÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷ " -#echo -e "${PURPLE} ÷÷÷÷÷÷÷÷ ÷÷÷÷÷ " -#echo -e "${PURPLE} ×÷÷÷÷÷÷÷÷÷÷÷÷÷×÷÷ " -#echo -e "${PURPLE} ÷÷÷÷÷÷÷ ÷ " -#echo -e "${PURPLE} × ≠ ∞ ÷÷÷÷÷÷÷÷ " -#echo -e "${PURPLE} = ÷÷÷÷÷÷÷π " -#echo -e "${PURPLE} × ÷ " -#echo -e "${PURPLE} = × √ " +echo -e "${PURPLE} = ÷÷÷÷÷÷÷ × ÷÷÷÷÷ " +echo -e "${PURPLE} ÷÷÷ ÷÷÷÷÷÷÷÷÷ ÷÷÷÷÷×÷÷÷ ÷÷ " +echo -e "${PURPLE} ÷÷ ÷ ÷ ÷ " +echo -e "${PURPLE} ÷÷π ÷ ∞÷÷÷÷ ÷ ÷÷÷ ÷ ÷÷ " +echo -e "${PURPLE} ÷÷ ÷ ÷÷ ÷ ÷÷× ÷ ÷÷ " +echo -e "${PURPLE} ∞÷÷ ÷ ÷ ÷÷÷÷÷ ÷∞ ÷÷÷ " +echo -e "${PURPLE} ÷÷ ÷ ÷÷ ÷÷ ÷÷÷ ÷÷ ÷ ÷ ÷÷≠ " +echo -e "${PURPLE} ≈÷÷ ÷÷ ≠÷÷ ÷÷÷÷÷÷ ÷÷÷√÷÷÷ ÷÷÷√÷÷÷ ÷÷ ÷ ÷÷ " +echo -e "${PURPLE} ÷ ÷ ÷÷÷÷÷÷π÷÷÷÷ ÷÷ ÷÷÷ ÷÷÷÷÷÷ ÷÷× ${USERNAME}@${HOSTNAME}${RESET}" +echo -e "${PURPLE} ÷÷ ÷÷÷÷÷÷÷÷÷÷÷ ÷÷÷÷÷ ÷÷÷÷÷ ≠÷÷÷ ${LINE}${RESET}" +echo -e "${PURPLE} ÷÷÷ ÷÷÷÷÷÷÷÷÷÷÷ ÷ ÷÷÷÷÷÷÷ ÷ ÷÷÷÷÷÷ ÷÷÷÷ $(get_distro_info)${RESET}" +echo -e "${PURPLE} ÷ ÷÷÷÷÷÷÷÷ ÷÷÷×÷÷÷÷÷÷÷÷÷÷÷÷ ÷÷÷÷÷÷ $(get_cpu_info)${RESET}" +echo -e "${PURPLE} ÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷ ÷ ÷÷÷= $(get_gpu_info)${RESET}" +echo -e "${PURPLE} ÷÷÷ ÷÷÷÷÷÷ ÷÷÷÷÷ ∞π÷÷÷÷÷÷÷÷ $(package_manager)${RESET}" +echo -e "${PURPLE} ÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷ $(get_terminal_info)${RESET}" +echo -e "${PURPLE} ÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷÷ $(get_uptime)${RESET}" +echo -e "${PURPLE} ÷÷÷÷÷÷÷÷ ÷÷÷÷÷ ${LINE}${RESET}" +echo -e "${PURPLE} ×÷÷÷÷÷÷÷÷÷÷÷÷÷×÷÷ " +echo -e "${PURPLE} ÷÷÷÷÷÷÷ ÷ " +echo -e "${PURPLE} × ≠ ∞ ÷÷÷÷÷÷÷÷ " +echo -e "${PURPLE} = ÷÷÷÷÷÷÷π " +echo -e "${PURPLE} × ÷ " +echo -e "${PURPLE} = × √ " #----------------------------------------------------------------------------------# # Arch Linux # -echo -e "${PURPLE} && " -echo -e "${PURPLE} &&&& " -echo -e "${PURPLE} &&&&&& " -echo -e "${PURPLE} &&&&&&& " -echo -e "${PURPLE} &&&&&&&& " -echo -e "${PURPLE} &&&&&&&&&& " -echo -e "${PURPLE} &&&&&&&&&& " -echo -e "${PURPLE} &&& &&&&&&&&& ${USERNAME}@${HOSTNAME}${RESET}" -echo -e "${PURPLE} &&&&&&&&&&&&&&&& ======================================================${RESET}" -echo -e "${PURPLE} &&&&&&&&&&&&&&&&&& OS → ${YELLOW}${DISTRO}${RESET}" -echo -e "${PURPLE} &&&&&&&&&&&&&&&&&&&& Cpu → ${YELLOW}${CPU_INFO} (${CORES})${RESET}" -echo -e "${PURPLE} &&&&&&&&&&&&&&&&&&&&&& Gpu → ${YELLOW}${GPU_INFO}${RESET}" -echo -e "${PURPLE} &&&&&&&&&&&&&&&&&&&&&&& Term → ${YELLOW}${TERMINAL}${RESET}" -echo -e "${PURPLE} &&&&&&&&&& &&&&&&&&&&& ======================================================${RESET}" -echo -e "${PURPLE} &&&&&&&&& &&&&&&&&&& " -echo -e "${PURPLE} &&&&&&&&&& &&&&&&&&&& " -echo -e "${PURPLE} &&&&&&&&&& &&&&&&&&&&& " -echo -e "${PURPLE} &&&&&&&&&&& &&&&&&&&& & " -echo -e "${PURPLE} &&&&&&&&&&&& &&&&&&&&&&&& " -echo -e "${PURPLE} &&&&&&&&&& &&&&&&&&&&& " -echo -e "${PURPLE} &&&&&& &&&&&&& " -echo -e "${PURPLE} &&&& &&&& " -echo -e "${PURPLE} & && " +#echo -e "${PURPLE} && " +#echo -e "${PURPLE} &&&& " +#echo -e "${PURPLE} &&&&&& " +#echo -e "${PURPLE} &&&&&&& " +#echo -e "${PURPLE} &&&&&&&& " +#echo -e "${PURPLE} &&&&&&&&&& " +#echo -e "${PURPLE} &&&&&&&&&& " +#echo -e "${PURPLE} &&& &&&&&&&&& ${USERNAME}@${HOSTNAME}${RESET}" +#echo -e "${PURPLE} &&&&&&&&&&&&&&&& ${LINE}${RESET}" +#echo -e "${PURPLE} &&&&&&&&&&&&&&&&&& $(get_distro_info)${RESET}" +#echo -e "${PURPLE} &&&&&&&&&&&&&&&&&&&& $(get_cpu_info)${RESET}" +#echo -e "${PURPLE} &&&&&&&&&&&&&&&&&&&&&& $(get_gpu_info)${RESET}" +#echo -e "${PURPLE} &&&&&&&&&&&&&&&&&&&&&&& $(package_manager)${RESET}" +#echo -e "${PURPLE} &&&&&&&&&& &&&&&&&&&&& $(get_terminal_info)${RESET}" +#echo -e "${PURPLE} &&&&&&&&& &&&&&&&&&& $(get_uptime)${RESET}" +#echo -e "${PURPLE} &&&&&&&&&& &&&&&&&&&& ${LINE}${RESET}" +#echo -e "${PURPLE} &&&&&&&&&& &&&&&&&&&&& " +#echo -e "${PURPLE} &&&&&&&&&&& &&&&&&&&& & " +#echo -e "${PURPLE} &&&&&&&&&&&& &&&&&&&&&&&& " +#echo -e "${PURPLE} &&&&&&&&&& &&&&&&&&&&& " +#echo -e "${PURPLE} &&&&&& &&&&&&& " +#echo -e "${PURPLE} &&&& &&&& " +#echo -e "${PURPLE} & && " -- cgit v1.2.3