#!/usr/bin/env bash # icyinfo, but better BLK="\e[30m" RED="\e[31m" GRN="\e[32m" YLW="\e[33m" BLU="\e[34m" PUR="\e[35m" CYN="\e[36m" BRED="\e[31m" BGRN="\e[32m" BYLW="\e[33m" BBLU="\e[34m" BPUR="\e[35m" BCYN="\e[36m" WHT="\e[37m" RST="\e[0m" BAR="████" ((LEN = ${#BAR} * 6)) COLOR_BARS="$RED$BAR$GRN$BAR$YLW$BAR$BLU$BAR$PUR$BAR$CYN$BAR$RST" user=$(whoami) host=$(hostname) kernel=$(uname -r) #uptime=$(uptime -p) # too long to print shell=$(basename $SHELL) os() { os=$(source /etc/os-release && echo $ID) export os } wm() { # id=$(xprop -root -notype _NET_SUPPORTING_WM_CHECK) # id=${id##* } # wm=$(xprop -id "$id" -notype -len 100 -f _NET_WM_NAME 8t) # wm=${wm/*_NET_WM_NAME = } # wm=${wm/\"} # wm=${wm/\"*} # wm=${wm,,} wm="2bwm" export wm } pkgs() { pkgs="$(kiss l | wc -l)" export pkgs } # get our vars os wm pkgs COL=$(tput cols) ROW=$(tput lines) ((PADY = ROW / 2 - 1 - ${#ENTS[@]} / 2)) ((PADX = COL / 2 - LEN / 2)) for ((i = 0; i < PADX; ++i)); do PADC="$PADC " done for ((i = 0; i < PADY; ++i)); do PADR="$PADR\n" done clear printf "%b" "$PADR" printf "%s%b" "$PADC" "┏┓╋╋╋╋╋┏┓ \n" printf "%s%b" "$PADC" "┣╋━┳┳┳━┫┗┳━┳┳┓ \n" printf "%s%b" "$PADC" "┃┃━┫┃┃╋┃┃┃╋┣┃┫ \n" printf "%s%b" "$PADC" "┗┻━╋┓┃┏┻┻┻━┻┻┛ \n" printf "%s%b" "$PADC" "╋╋╋┗━┻┛\n\n" #printf "%s%b" "$PADC" "$COLOR_BARS\n\n" printf "%s%b" "$PADC" "${CYN}$user${RST}@${CYN}$host${RST}\n" printf "%s%b" "$PADC" "os: ${CYN}$os${RST}\n" printf "%s%b" "$PADC" "kernel: ${CYN}$kernel${RST}\n" printf "%s%b" "$PADC" "pkgs: ${CYN}$pkgs${RST}\n" printf "%s%b" "$PADC" "wm: ${CYN}$wm${RST}\n" printf "%s%b" "$PADC" "shell: ${CYN}$shell${RST}\n" printf "%s%b" "$PADC" "$COLOR_BARS\n" tput civis read -n 1 tput cnorm