-
Notifications
You must be signed in to change notification settings - Fork 0
/
FetchImg.go
72 lines (53 loc) · 2.79 KB
/
FetchImg.go
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
package main
import (
"github.com/charmbracelet/lipgloss"
)
func RenderFetch() string {
image := " ,\n" +
" ,-. _,---._ __ / \\\n" +
" / ) .-' `./ / \\\n" +
" ( ( ,' `/ /|\n" +
" \\ `-\" \\'\\ / |\n" +
" `. , \\ \\ / |\n" +
" /`. ,'-`----Y |\n" +
" ( ; | '\n"+
" | ,-. ,-' | /\n"+
" | | ( | hjw | /\n"+
" ) | \\ `.___________|/\n" +
" `--' `--'\n"
img := lipgloss.NewStyle().MarginRight(12).Foreground(lipgloss.AdaptiveColor{Light: "#DB6BF3", Dark: "#CB0FF3"}).Render(image)
user := lipgloss.NewStyle().Align(lipgloss.Left).Foreground(lipgloss.Color("#9F03CF")).Render(GetUser())
at := lipgloss.NewStyle().Align(lipgloss.Left).Bold(true).Render("@")
host := lipgloss.NewStyle().Align(lipgloss.Left).Foreground(lipgloss.Color("#844E94")).Render(GetHost())
OS := lipgloss.NewStyle().Align(lipgloss.Left).Width(9).Bold(true).Foreground(lipgloss.Color("#7633D7")).Render("os: ")
osName := lipgloss.NewStyle().Align(lipgloss.Left).Foreground(lipgloss.Color("#4D425E")).Render(GetOS())
ker := lipgloss.NewStyle().Align(lipgloss.Left).Width(9).Bold(true).Foreground(lipgloss.Color("#672DBD")).Render("ker: ")
kerName := lipgloss.NewStyle().Align(lipgloss.Left).Foreground(lipgloss.Color("#5F5073")).Render(GetKer())
shell := lipgloss.NewStyle().Align(lipgloss.Left).Width(9).Bold(true).Foreground(lipgloss.Color("#57269E")).Render("shell: ")
shellName := lipgloss.NewStyle().Align(lipgloss.Left).Foreground(lipgloss.Color("#6A5A82")).Render(GetShell())
pac := lipgloss.NewStyle().Align(lipgloss.Left).Width(9).Bold(true).Foreground(lipgloss.Color("#4A2188")).Render("pks: ")
pacNum := lipgloss.NewStyle().Align(lipgloss.Left).Foreground(lipgloss.Color("#7B6896")).Render(GetPks())
uhBox := lipgloss.JoinHorizontal(lipgloss.Left, user, at, host)
osBox := lipgloss.JoinHorizontal(lipgloss.Left, OS, osName)
kerBox := lipgloss.JoinHorizontal(lipgloss.Left, ker, kerName)
shellBox := lipgloss.JoinHorizontal(lipgloss.Left, shell, shellName)
pacBox := lipgloss.JoinHorizontal(lipgloss.Left, pac, pacNum)
uhStyle := lipgloss.NewStyle().
BorderStyle(lipgloss.NormalBorder()).
Width(20).
Align(lipgloss.Center).
BorderBottom(true)
restStyle := lipgloss.NewStyle().
Width(20).
Align(lipgloss.Center)
fetch := lipgloss.JoinVertical(lipgloss.Left,
uhStyle.Render(uhBox),
restStyle.Render(osBox),
restStyle.Render(kerBox),
restStyle.Render(shellBox),
restStyle.Render(pacBox),
)
fetchStyle := lipgloss.NewStyle().Align(lipgloss.Center).MarginTop(2)
row := lipgloss.JoinHorizontal(lipgloss.Top, img, fetchStyle.Render(fetch))
return row
}