#!/bin/sh

mem=$(busybox free -m | awk '/^Mem:/ {print $3"m/"$2"m" }')
kernel=$(uname -r)
#kernelsize=$(du -sh /boot/vmlinuz-venom | awk '{print $1}')
. /etc/os-release
os=${PRETTY_NAME}
hn=$(cat /etc/hostname)
shell=$(basename $SHELL)
mksh=$(scratch info mksh-git | awk '/Installed/{print $2}')
init=$(scratch info sysvinit | awk '/Installed/{print $2}')
cpu=$(awk -F ": " 'NR==5 {print $2}' /proc/cpuinfo | awk '{print $1" "$2" "$3" "$4}')
gpu=$(awk -F ": " 'NR==5 {print $2}' /proc/cpuinfo | awk '{print $6" "$7}')
tr=$(scratch info foot | awk '/Installed/{print $2}')
font="$(awk -F'=' '/font/{print $2}' "${HOME}/.config/gtk-3.0/settings.ini")"
wm=$(scratch info dwl-git | awk '/Installed/{print $2}')
spkg=$(ls $(pkgadd --print-dbdir) | wc -l) 
glibc=$(scratch info glibc | awk '/Installed/{print $2}')
gcc=$(scratch info gcc | awk '/Installed/{print $2}')
binut=$(scratch info binutils | awk '/Installed/{print $2}')
pyth=$(scratch info python3 | awk '/Installed/{print $2}')
wl=$(scratch info wayland | awk '/Installed/{print $2}')
snd=$(scratch info alsa-lib | awk '/Installed/{print $2}')

full() {
cat << EOF

	> ${os}
	> linux-${kernel}
	> sysvinit-${init%-*}
	> glibc-${glibc%-*}
	> gcc-${gcc%-*}
	> binutils-${binut%-*}
	> python-${pyth%-*}
	> spkg: ${spkg}
	> ${font}
	> mksh-git-${mksh}
	> foot-${tr%-*}
	> wayland-${wl%-*}
	> dwl-git-${wm}
	> alsa-${snd%-*}
	> ${cpu}	
	> ${gpu}
	> ${mem}

EOF
}

full
