dotfiles

<-- duh.
git clone https://hhvn.uk/dotfiles
git clone git://hhvn.uk/dotfiles
Log | Files | Refs | Submodules | LICENSE

infowall (1931B)


      1 #!/bin/sh
      2 
      3 LC_ALL=C
      4 
      5 (
      6 	echo "Uptime:$(uptime -p | awk '{$1="";print $0}')"
      7 	echo "Time: $(date '+%A %d, %B, %Y - %H:%M:%S %Z')"
      8 	free -h | tail -n +2 | awk '{print $1" "$3"/"$2}' | sed "/Mem:/ s~$~ (most intensive: $(ps aux | awk '{$1="";$2="";$3="";print $0}' | sed 's/\.//' | sort -n -r | awk '{print $8}' | head -n 1))~"
      9 	echo "Running processes: $(ps a | wc -l)"
     10 	threads=$(grep -c ^processor /proc/cpuinfo)
     11 	[ ! -z $TERM ] && echo "Terminal: $TERM"
     12 	[ ! -z $EDITOR ] && echo "Editor: $EDITOR"
     13 	[ ! -z $SHELL ] && {
     14 		printf "Shell: $SHELL "
     15 		[ ! -z $SHLVL ] && echo "($SHLVL deep)" || echo
     16 	}
     17 	echo "CPU cores/threads: $threads"
     18 	echo "CPU usage: $(echo "scale=2; $(ps -e -o %cpu | awk '{s+=$1} END {print s}')/$threads" | bc | sed 's/^\./0\./')% (most intensive: $(ps aux | awk '{$1="";$2="";print $0}' | sed 's/\.//' | sort -n -r | awk '{print $9}' | head -n 1))"
     19 	echo "External IPv4: $(curl -qs icanhazip.com)"
     20 	echo "Internal IP*: $(ip a | grep '^[[:space:]]*inet' | grep -Ev '127.0.0.1/8|::1/128' | awk '{print $2}' | tr '\n' '\t' | sed 's/\t/, /g;s~/[0-9]*,~,~g')"
     21 	uname -a | awk '{printf "Host: "$2"\nKernel: "$1" "$3"\nOS: "$13"\nArch: "$12"\n"}'
     22 	libc=$(ldd 2>&1 | head -n 1 | sed 's/(.*//')
     23 	[ "$libc" != "" ] && echo "libc: $libc"
     24 	echo "Distro: $(sed 's/.*="//g;s/"$//g' < /etc/os-release | tail -n 1)"
     25 	[ -e /usr/bin/xbps-query ] && {
     26 		echo "Pkgs (xbps): $(xbps-query -l | wc -l)"
     27 		echo "Manually inst. pkgs (xbps): $(xbps-query -m | wc -l)" 
     28 		echo "Orphan pkgs (xbps): $(xbps-query -O | wc -l)"
     29 	}
     30 	df -h | tail -n +2 | awk '$1 != "tmpfs" && $1 != "devtmpfs" && $1 != "cgroup" {print "Disk "$1": "$3"/"$2" (on "$6")"}'
     31 	for colour in $(seq 16)
     32 	do
     33 		printf "$(tput setaf $(($colour-1)))$(tput setab $(($colour-1)))   $(tput sgr0)"
     34 		[ $colour = 8 ] && printf '\n'
     35 	done | sed 's/^/Colours: /'
     36 	echo
     37 ) | sed "s~^~$(tput bold)$(tput setaf 3)~g;s/: /$(tput sgr0)\t: $(tput setaf 5)/" | column --table -s '	'