Skip to content

Instantly share code, notes, and snippets.

@sleepntsheep
Last active June 9, 2021 13:37
Show Gist options
  • Save sleepntsheep/ad8ca9dc7c95ee7365a9a744c0ec8d16 to your computer and use it in GitHub Desktop.
Save sleepntsheep/ad8ca9dc7c95ee7365a9a744c0ec8d16 to your computer and use it in GitHub Desktop.
#!/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}
"

shisutemu

small linux fetch script This is really bad dont use it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment