-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathfm6000
executable file
·52 lines (37 loc) · 1.42 KB
/
fm6000
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/sh
# Prepare ------------------------------------------------------------------------------------------
info=$(gum style --border rounded --border-foreground 6 --padding '1 2' \
"[1;38;5;2mOS [0m<your_os>
[1;38;5;4mKERNEL [0m$(uname -sr)
[1;38;5;1mDE [0m<your_de>
[1;38;5;3mSHELL [0m$(basename "${SHELL}")
[1;38;5;5mUPTIME [0m$(uptime -p | cut -c 4-)
[1;38;5;6mPACKAGES [0m<your_packages>")
# You can get other art on https://github.com/anhsirk0/fetch-master-6000/tree/master/ascii_arts
art=$(gum style --foreground 6 ' დოოოოოდ
| |
| | ╭
|-Ο Ο-| │
Ͼ ∪ Ͽ │
| | ╯
ˏ`-.ŏ.-´ˎ
@
@')
# Display ------------------------------------------------------------------------------------------
terminal_size=$(stty size)
terminal_height=${terminal_size% *}
terminal_width=${terminal_size#* }
prompt_height=${PROMPT_HEIGHT:-1}
print_test() {
no_color=$(printf '%b' "${1}" | sed -e 's/\x1B\[[0-9;]*[JKmsu]//g')
[ "$(printf '%s' "${no_color}" | wc --lines)" -gt $(( terminal_height - prompt_height )) ] && return 1
[ "$(printf '%s' "${no_color}" | wc --max-line-length)" -gt "${terminal_width}" ] && return 1
gum style --align center --width="${terminal_width}" "${1}" ''
printf '%b' "\033[A"
exit 0
}
# Default layout
print_test "$(gum join --horizontal "${art}" "${info}")"
# Other layout
print_test "${info}"
exit 1