dotfiles/bin/catfetch
Smirnov Alexandr ae9fa7059a Simple update
2021-03-20 11:30:02 +02:00

24 lines
876 B
Bash
Executable file

#!/bin/sh
kernel=$(cat /proc/sys/kernel/osrelease|cut -d '-' -f1)
[ ! "$wm" ] && [ "$DISPLAY" ] && command -v xprop >/dev/null && {
wmname="$(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 \")"
}
shell=$(basename $SHELL)
manager=$(which apt pacman yay 2>/dev/null)
manager=${manager##*/}
case "$manager" in
apt) packages="$(dpkg-query -f '${binary:Package}\n' -W | wc -l)";;
yay) packages="$(yay -Q | wc -l)";;
pacman) packages="$(pacman -Q | wc -l)";;
esac
bold=$(tput bold)
reset="\e[0m"
blue="\e[36m"
echo -e " ${blue}${bold} WM ${reset}${wmname}"
echo -e " /\_/\ ${blue}${bold} SHELL ${reset}${shell}"
echo -e " (=^.^=) ${blue}${bold}KERNEL ${reset}${kernel}"
echo -e " (\") (\")_/ ${blue}${bold} PKG ${reset}${packages}"