-
Notifications
You must be signed in to change notification settings - Fork 0
/
ufetch-instantos
52 lines (46 loc) · 1.36 KB
/
ufetch-instantos
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
#!/bin/bash
# ufetch-istantos - tiny system info for IstantOS
# System information
host=$(</etc/hostname)
os='IstantOS'
kernel=$(uname -sr)
uptime=$(uptime -p | sed 's/up //')
packages=$(pacman -Q | wc -l)
shell=$(basename "$SHELL")
# User interface detection
get_ui() {
for f in "$@"; do
wm=$(tail -n 1 "$f" 2> /dev/null | awk '{print $2}')
[ -n "$wm" ] && { echo "$wm"; return; }
done
}
rcwm=$(get_ui "$HOME/.xinitrc" "$HOME/.xsession")
if [ -n "$DE" ]; then
ui="$DE"
uitype='DE'
elif [ -n "$WM" ]; then
ui="$WM"
uitype='WM'
elif [ -n "$XDG_CURRENT_DESKTOP" ]; then
ui="$XDG_CURRENT_DESKTOP"
uitype='DE'
elif [ -n "$DESKTOP_SESSION" ]; then
ui="$DESKTOP_SESSION"
uitype='DE'
elif [ -n "$rcwm" ]; then
ui="$rcwm"
uitype='WM'
elif [ -n "$XDG_SESSION_TYPE" ]; then
ui="$XDG_SESSION_TYPE"
fi
ui=$(basename "$ui")
## OUTPUT
echo
echo -e "\e[1;34m ,-''-, \e[1;34m${USER}\e[0m@\e[1;34m${host}\e[0m"
echo -e "\e[1;34m : .''. : \e[1;34mOS: \e[0m${os}"
echo -e "\e[1;34m : ',,' : \e[1;34mKERNEL: \e[0m${kernel}"
echo -e "\e[1;34m '-____:__ \e[1;34mUPTIME: \e[0m${uptime}"
echo -e "\e[1;34m : \`. \e[1;34mPACKAGES: \e[0m${packages}"
echo -e "\e[1;34m \`._.' \e[1;34mSHELL: \e[0m${shell}"
echo -e "\e[1;34m \e[1;34m${uitype}: \e[0m${ui}"
echo