forked from rachelambda/mfetch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mfetch
executable file
·42 lines (33 loc) · 1.25 KB
/
mfetch
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
#!/bin/bash
# Forked from https://github.com/depsterr/mfetch by Zac the Wise
# I'm a beginner in bash scripting, I saw a lovely 'fetch' tool
# and noticed it didn't have support for Mac OS, the goal is
# to provide a similar tool for Mac users.
# read system info
host=$(hostname)
# get OS name and version
os_name=$(sw_vers | awk 'NR==1{print $2 " " $3 " " $4}')
os_ver=$(sw_vers | awk 'NR==2{print $2 " " $3 " " $4}')
# get kernel name and version
kernel=$(uname -rs)
# Get terminal
term_full="$TERM ${TERM_PROGRAM//_/ }"
terminal=$(echo $term_full | awk '{print $2 " " $3 " " $4}')
# Colors and palette method taken from dylanaraps pftech
# https://github.com/dylanaraps/pfetch
c0='[0m';
c1='[31m'; c2='[32m'
c3='[33m'; c4='[34m'
c5='[35m'; c6='[36m'
c7='[37m'; c8='[38m'
palette="[7m$c1 $c1 $c2 $c2 $c3 $c3 $c4 $c4 $c5 $c5 $c6 $c6 [m"
# Output
cat << EOF
${c5} (/ ${USER}${c0}@${c5}${host}
${c5} .---__--. ${c6}os${c0} ${os_name} ${os_ver}
${c5} / \ ${ARTR3}${c6}kernel${c0} ${kernel}
${c5} | / ${c6}shell${c0} ${SHELL##*/}
${c5} | \_ ${c6}trm${c0} ${terminal}
${c5} \ /
${c5} \`._.-._.\` ${palette}
EOF