aboutsummaryrefslogtreecommitdiff
path: root/nofetch
blob: 7e9bfe1f5018573fc4d8a2400841320e73ef9926 (plain) (blame)
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/usr/bin/env bash

if [[ $1 == "" ]];
then
	rng=$((1 + $RANDOM % 12 ))
else
	if [[ $1 -lt 13 ]];
	then
		rng=$1
	else
		rng=$((1 + $RANDOM % 12 ))
	fi
fi

uname -o &> /dev/null

if [ $(uname -s) == "Darwin" ]
then
        osname=$(sw_vers | cut -d':' -f2- | head -n 1 | xargs)
elif [ -f /etc/os-release ]
then
	osname=$(cat /etc/os-release | grep -w NAME | head -1 | sed 's/NAME=//g' | sed 's/\"//g' | sed 's/ Linux//g')
elif [ $? -eq 0 ]
then
	osname=$(uname -o)
else
	osname="Unknown"
fi

if [ $rng -eq 1 ] &> /dev/null
then
        nofetch="probably a computer"
elif [ $rng -eq 2 ] &> /dev/null
then
        nofetch="there's probably some ram in there"
elif [ $rng -eq 3 ] &> /dev/null
then
        nofetch="init should ideally be running"
elif [ $rng -eq 4 ] &> /dev/null
then
        nofetch="yeah"
elif [ $rng -eq 5 ] &> /dev/null
then
        nofetch="you should probably go outside"
elif [ $rng -eq 6 ] &> /dev/null
then
        nofetch="i would be lead to believe that / is mounted"
elif [ $rng -eq 7 ] &> /dev/null
then
        nofetch="hey, what's this knob do ?"
elif [ $rng -eq 8 ] &> /dev/null
then
        nofetch="do you have games on your phone ?"
elif [ $rng -eq 9 ] &> /dev/null
then
        nofetch="you mean to tell me there aren't little men in this box?"
elif [ $rng -eq 10 ] &> /dev/null
then
        nofetch="plan 4 from the front door"
elif [ $rng -eq 11 ] &> /dev/null
then
	nofetch="i use "$osname" btw"
elif [ $rng -eq 12 ] &> /dev/null
then
	nofetch="if you're reading this, it's already too late"
else
        nofetch="something has gone terribly wrong"
fi

osname=$(echo $osname | sed 's/FreeBSD //g')

if [ $1 == "-o" ] &> /dev/null || [ $2 == "-o" ] &> /dev/null
then
	echo "$osname"
else
	echo " "
	echo "> $nofetch" | tr '[:upper:]' '[:lower:]'
	echo "> $osname $(uname -smr)" | tr '[:upper:]' '[:lower:]'
	echo " "
fi