fixed the default config and some other stuff idk
This commit is contained in:
parent
51f01af6d8
commit
dcc3c10bb3
3 changed files with 18 additions and 14 deletions
|
@ -99,7 +99,7 @@ var xerolinux string
|
|||
var windows string
|
||||
|
||||
func GetAsciiInternal(distroID string) string {
|
||||
switch distroID {
|
||||
switch strings.ToLower(distroID) {
|
||||
case "alpine":
|
||||
return alpine
|
||||
case "arcolinux":
|
||||
|
@ -150,9 +150,7 @@ func GetAsciiInternal(distroID string) string {
|
|||
return void
|
||||
case "xerolinux":
|
||||
return xerolinux
|
||||
case "arch":
|
||||
return arch
|
||||
case "Archcraft":
|
||||
case "arch", "Archcraft":
|
||||
return arch
|
||||
case "windows":
|
||||
return windows
|
||||
|
|
7
main.go
7
main.go
|
@ -19,16 +19,17 @@ func handleConfig() {
|
|||
if os.IsNotExist(folder) {
|
||||
os.Mkdir(filepath.Dir(data.GetConfigFile()), os.ModePerm)
|
||||
}
|
||||
|
||||
defaultconfig := "println green neOwOfetchh 🔥\ninfo white username\nprint blue @\ninfoln blue hostname\nprint white uptime: \ninfoln red uptime\nprint white shell: \ninfoln blue shell\nprint white distro: \ninfoln blue distro\nprint white terminal: \ninfoln blue terminal\nprint white memory: \ninfo blue memoryUsed\nprint white /\ninfoln blue memoryAll"
|
||||
if os.IsNotExist(file) {
|
||||
println("config was not found. a default config file has been generated in '~/.config/neowofetch/conf'. rerun the program")
|
||||
f, _ := os.Create(data.GetConfigFile())
|
||||
_, _ = f.WriteString("println green neOwOfetch 🔥\ninfo white username\nprint blue @\ninfoln blue hostname\nprint white uptime: \ninfoln red uptime\nprint white shell: \ninfoln blue shell\nprint white distro: \ninfoln blue distro\nprint white terminal: \ninfoln blue terminal\nprint white memory: \ninfo blue memoryUsed\nprint white /\ninfoln blue memoryAll")
|
||||
_, _ = f.WriteString(defaultconfig)
|
||||
os.Exit(0)
|
||||
} else {
|
||||
body, _ := ioutil.ReadFile(data.GetConfigFile())
|
||||
sbody := (string(body))
|
||||
if utils.Defaultconf {
|
||||
sbody = "println green neOwOfetchh 🔥\ninfo white username\nprint blue @\ninfoln blue hostname\nprint white uptime: \ninfoln red uptime\nprint white shell: \ninfoln blue shell\nprint white distro: \ninfoln blue distro\nprint white terminal: \ninfoln blue terminal\nprint white memory: \ninfo blue memoryUsed\nprint white /\ninfoln blue memoryAll"
|
||||
sbody = defaultconfig
|
||||
}
|
||||
fbody := strings.Split(sbody, "\n")
|
||||
for _, line := range fbody {
|
||||
|
|
|
@ -30,12 +30,12 @@ var pngWidth = 12
|
|||
var pngHeight = 12
|
||||
var pngData []byte
|
||||
|
||||
func Initcolor() {
|
||||
colorconf := os.Getenv("HOME") + "/.config/neowofetch/colors"
|
||||
folderconf := filepath.Dir(colorconf)
|
||||
var colorconf = os.Getenv("HOME") + "/.config/neowofetch/colors"
|
||||
var folderconf = filepath.Dir(colorconf)
|
||||
var _, existcolorconf = os.Stat(colorconf)
|
||||
var _, existfolderconf = os.Stat(folderconf)
|
||||
|
||||
_, existcolorconf := os.Stat(colorconf)
|
||||
_, existfolderconf := os.Stat(folderconf)
|
||||
func Initcolor() {
|
||||
|
||||
if os.IsNotExist(existfolderconf) {
|
||||
os.Mkdir(folderconf, os.ModePerm)
|
||||
|
@ -180,8 +180,12 @@ func CutePrint(
|
|||
if !colorold {
|
||||
fmt.Printf("%s%s\x1b[0m", parsedFormat.colorFormat, message)
|
||||
} else {
|
||||
|
||||
if colorold && hascolor {
|
||||
if os.IsNotExist(existcolorconf) {
|
||||
println("color was not found. a default config file has been generated in '~/.config/neowofetch/colors'. rerun the program")
|
||||
f, _ := os.Create(colorconf)
|
||||
_, _ = f.WriteString("red 255 0 0 \ngreen 0 255 0\nblue 0 0 255\nwhite 255 255 255")
|
||||
os.Exit(0)
|
||||
} else if colorold && hascolor {
|
||||
switch {
|
||||
case strings.Contains(format, "black"):
|
||||
fmt.Printf("\033[1;30m%s\033[0m", message)
|
||||
|
@ -201,6 +205,7 @@ func CutePrint(
|
|||
fmt.Printf("\033[1;37m%s\033[0m", message)
|
||||
case strings.Contains(format, "*"):
|
||||
fmt.Printf("\033[1;37m%s\033[0m", message)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue