small linux fetch script This is really bad dont use it
Last active
June 9, 2021 13:37
-
-
Save sleepntsheep/ad8ca9dc7c95ee7365a9a744c0ec8d16 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
UWU="" | |
OWO=" " | |
uptime=$(echo $(uptime -p) | sed "s/hours/$UWU/" | sed "s/minutes/$UWU/" | sed "s/days/$UWU/" | sed "s/up/$UWU/" | sed "s/$OWO/$UWU/g" | sed "s/,/:/g") | |
de=$XDG_CURRENT_DESKTOP | |
wm=$(id=$(xprop -root -notype | awk '$1=="_NET_SUPPORTING_WM_CHECK:"{print $5}'); xprop -id "${id}" -notype -f _NET_WM_NAME 8t | grep "_NET_WM_NAME = " | cut --delimiter=' ' --fields=3 | cut --delimiter='"' --fields=2) | |
distro=$( (lsb_release -ds || cat /etc/*release || uname -om ) 2>/dev/null | head -n1) | |
distro="${distro//"\""/""}" | |
kernel_version=$(uname -r) | |
ram_use=$(free -m) | |
IFS=$'\n' read -rd '' -a ram_use_arr <<< "$ram_use" | |
ram_use="${ram_use_arr[1]}" | |
ram_use=$(echo "$ram_use" | tr -s " ") | |
IFS=' ' read -ra ram_use_arr <<< "$ram_use" | |
total_ram="${ram_use_arr[1]}" | |
ram_use="${ram_use_arr[2]}" | |
color1="\033[38;5;250m" | |
color4="\033[37m" | |
color3="\033[38;5;175m" | |
color2="\033[38;5;115m" | |
color5="\033[38;5;151m" | |
reset="\033[0m" | |
printf '%b\n' " | |
${color3}os${color4} → ${color1}${distro}${reset} | |
${color3}kr${color4} → ${color1}${kernel_version}${reset} | |
${color3}up${color4} → ${color1}${uptime}${reset} | |
${color3}de${color4} → ${color1}${de}${reset} | |
${color3}wm${color4} → ${color1}${wm}${reset} | |
${color3}me${color4} → ${color1}${ram_use} / ${total_ram}${reset} | |
${color5}≧◡≦ Welcome to ${color2}${HOSTNAME}${reset}, ${color2}${USER}${reset} | |
" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment