Skip to content

Commit 7080cf4

Browse files
committed
Add Custom Ascii
1 parent 64f9883 commit 7080cf4

3 files changed

Lines changed: 34 additions & 3 deletions

File tree

config.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ type Config struct {
1313
ShowBaseboard bool `json:"showBaseboard"`
1414
ShowAscii bool `json:"showAscii"`
1515
UseDefaultColors bool `json:"useDefaultColors"`
16+
UseSmallAscii bool `json:"useSmallAscii"`
1617
AsciiColor string `json:"asciiColor"`
18+
UseCustomAscii bool `json:"useCustomAscii"`
19+
CustomAsciiPath string `json:"customAsciiPath"`
1720
UserColor string `json:"userColor"`
1821
SepColor string `json:"sepColor"`
1922
TitleColor string `json:"titleColor"`
@@ -45,6 +48,9 @@ func newConfig() Config {
4548
config.ShowBios = true
4649
config.ShowBaseboard = true
4750
config.ShowAscii = true
51+
config.UseSmallAscii = false
52+
config.UseCustomAscii = false
53+
config.CustomAsciiPath = ""
4854
config.UseDefaultColors = true
4955
config.AsciiColor = "Blue"
5056
config.UserColor = "Red"

main.go

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,21 @@ llllllllllllll lllllllllllllllllll
9696
'ccllllllllll lllllllllllllllllll
9797
' \\*:: :ccllllllllllllllll
9898
''''''''''*::cll
99-
''''`
100-
winArtResult := strings.Split(winArt, "\n")
99+
''''`
100+
var winArtSmall string = ` .
101+
....,,:;+ccll
102+
..,+:; cllllllllllllllll
103+
,cclllllllll lllllllllllllllll
104+
llllllllllll lllllllllllllllll
105+
llllllllllll lllllllllllllllll
106+
llllllllllll lllllllllllllllll
107+
108+
llllllllllll lllllllllllllllll
109+
llllllllllll lllllllllllllllll
110+
llllllllllll lllllllllllllllll
111+
'ccllllllll lllllllllllllllll
112+
' \\*:: :ccllllllllllllll
113+
''''''''''*::;`
101114
memory, err := ghw.Memory()
102115
if err != nil {
103116
fmt.Printf("Error getting memory info: %v", err)
@@ -118,7 +131,19 @@ llllllllllllll lllllllllllllllllll
118131
if err = jsonParser.Decode(&config); err != nil{
119132
log.Fatal("Error Parsing Config File: ", err.Error())
120133
}
121-
134+
var winArtResult []string
135+
if (config.UseSmallAscii){
136+
winArtResult = strings.Split(winArtSmall, "\n")
137+
} else {
138+
winArtResult = strings.Split(winArt, "\n")
139+
}
140+
if (config.UseCustomAscii){
141+
content, err := ioutil.ReadFile(config.CustomAsciiPath)
142+
if err != nil {
143+
log.Fatal(err)
144+
}
145+
winArtResult = strings.Split(string(content), "\n")
146+
}
122147
title := xterm256.Green
123148
ascii := xterm256.Blue
124149
sep := xterm256.Red

winfetch-win64.zip

3.84 MB
Binary file not shown.

0 commit comments

Comments
 (0)