-
Notifications
You must be signed in to change notification settings - Fork 0
/
fetchme
executable file
·60 lines (53 loc) · 1.87 KB
/
fetchme
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/sh
while [ ! "$term" ]; do
while IFS=': ' read -r key val; do
case $key in
PPid) ppid=$val; break;;
esac
done < "/proc/${ppid:-$PPID}/status"
read -r name < "/proc/$ppid/comm"
case $name in
*sh) ;;
"${0##*/}") ;;
*[Ll]ogin*|*init*) term=linux;;
*) term="$name";;
esac
done
id_bloat=$(xprop -root _NET_SUPPORTING_WM_CHECK)
id=${id_bloat##* }
distro=$(. /etc/os-release ; echo "$ID")
wm_bloat=$(xprop -id "$id" _NET_WM_NAME)
wm="$(echo $wm_bloat | cut -d'"' -f 2)"
shell="$(basename ${SHELL})"
packages="$(pacman -Qq | wc -l)"
user="$(printenv USER)"
# color escapes
bold="$(tput bold)"
white="$(tput setaf 7)"
yellow="$(tput setaf 12)"
red="$(tput setaf 1)"
blue="$(tput setaf 4)"
green="$(tput setaf 2)"
orange="$(tput setaf 8)"
purple="$(tput setaf 5)"
cyan="$(tput setaf 6)"
reset="$(tput sgr0)"
cbg="${reset}${bold}${bgaccent}${white}"
cr="${reset}"
c0="${reset}${bold}"
c1="${reset}${accent}"
# build the color bars
BAR="━━━━━"
((LEN = ${#BAR} * 6))
OUTT="$white$BAR$white$BAR$blue$BAR$blue$BAR$white$BAR$white$BAR$RST"
OUTB="$purple$BAR$purple$BAR$cyan$BAR$cyan$BAR$purple$BAR$purple$BAR$RST"
# creds to gfetch for the ghost
cat <<EOF
$white$BAR$white$BAR$blue$BAR$blue$BAR$white$BAR$white$BAR$RST
${c0}${CYN} ╔══╗ ♫ ${c0}${blue}${c0}${yellow} os ${reset}${c0}${blue} ${cr}${white}${distro}${reset}
${c0}${CYN} ║██║ ♪♪ ${c0}${blue}${c0}${yellow} wm ${reset}${c0}${blue} ${cr}${white}${wm}${reset}
${c0}${CYN} ║██║ ♫♪ ${c0}${blue}${c0}${yellow} tm ${reset}${c0}${blue} ${cr}${white}${term}${reset}
${c0}${CYN} ║ ◎♫♪♫ ${c0}${blue}${c0}${yellow} sh ${reset}${c0}${blue} ${cr}${white}${shell}${reset}
${c0}${CYN} ╚══╝ ${c0}${blue}${c0}${yellow} ur ${reset}${c0}${blue} ${cr}${white}${user}${reset}
$white$BAR$white$BAR$blue$BAR$blue$BAR$white$BAR$white$BAR$RST
EOF