#!/bin/bash c=3 b=4 for j in c b; do for i in {0..7}; do printf -v $j$i "%b" "\e[${!j}${i}m" done done user=$(whoami) host=$(uname -a | awk '{print $2}') memory=$(free -h) os=$(source /etc/os-release && echo $PRETTY_NAME) kernel=$(uname -sr) wm="$(xprop -id $(xprop -root -notype | awk '$1=="_NET_SUPPORTING_WM_CHECK:"{print $5}') -notype -f _NET_WM_NAME 8t | grep "WM_NAME" | cut -f2 -d \")" mem=$(free -m | sed -n 's/^Mem:\s\+[0-9]\+\s\+\([0-9]\+\)\s.\+/\1/p') pkgs="$(pacman -Q | wc -l)" shell=$(echo "$SHELL" | awk -F/ '{for ( i=1; i <= NF; i++) sub(".", substr(toupper($i),1,1) , $i); print $NF}') colors=$(for i in {0..7}; do echo -en "\e[${1}$((30 + $i))m  "; done) license="GNU-GPL3" get_mem(){ while IFS=":" read -r a b; do case $a in "MemTotal") ((mem_used+=${b/kB})); mem_total="${b/kB}" ;; "Shmem") ((mem_used+=${b/kB})) ;; "MemFree" | "Buffers" | "Cached" | "SReclaimable") mem_used="$((mem_used-=${b/kB}))" ;; esac done < /proc/meminfo mem_used="$((mem_used / 1024))" mem_total="$((mem_total / 1024))" } get_mem get_uptime() { # Uptime works by retrieving the data in total seconds and then # converting that data into days, hours and minutes using simple # math. IFS=. read -r s _