all repos — dotfiles @ f7712f82ec2a7cf22789e1eef4cafe9b34841d6a

my *nix dotfiles

bin/icyinfo.sh (view raw)

 1#!/usr/bin/env bash
 2# icyinfo, but better
 3
 4BLK="\e[30m"
 5RED="\e[31m"
 6GRN="\e[32m"
 7YLW="\e[33m"
 8BLU="\e[34m"
 9PUR="\e[35m"
10CYN="\e[36m"
11BRED="\e[31m"
12BGRN="\e[32m"
13BYLW="\e[33m"
14BBLU="\e[34m"
15BPUR="\e[35m"
16BCYN="\e[36m"
17WHT="\e[37m"
18RST="\e[0m"
19
20BAR="▁▁▁▁"
21COLOR_BARS="$RED$BAR$GRN$BAR$YLW$BAR$BLU$BAR$PUR$BAR$CYN$BAR$RST"
22
23user=$(whoami)
24host=$(hostname)
25kernel=$(uname -r)
26uptime=$(uptime -p)    # too long to print
27shell=$(basename $SHELL)
28
29os() {
30	os=$(source /etc/os-release && echo $ID)
31	export os
32}
33
34wm() {
35	id=$(xprop -root -notype _NET_SUPPORTING_WM_CHECK)
36	id=${id##* }
37	wm=$(xprop -id "$id" -notype -len 100 -f _NET_WM_NAME 8t)
38	wm=${wm/*_NET_WM_NAME = }
39	wm=${wm/\"}
40	wm=${wm/\"*}
41	wm=${wm,,}
42	export wm
43}
44
45
46os
47wm
48
49clear
50printf "$COLOR_BARS\n\n"
51printf "${CYN}$user${RST}@${CYN}$host${RST}     ${CYN}   |\___/|${RST}\n"
52printf "                ${CYN}/     \\ ${RST} \n"
53printf "               ${CYN}/__${RST}${PUR}^ ^${RST}${CYN}__\\ ${RST} \n"
54printf "                  ${CYN}\o/    ${RST}\n\n"
55printf "os:               ${CYN}$os${RST}\n"
56printf "kernel:   ${CYN}$kernel${RST}\n"
57# printf "uptime:    ${CYN}$uptime${RST}\n"
58printf "wm:                   ${CYN}$wm${RST}\n"
59printf "shell:               ${CYN}$shell${RST}\n"
60printf "$COLOR_BARS\n"