diff --git a/main.go b/main.go index 278f55a..9f7d3ae 100644 --- a/main.go +++ b/main.go @@ -26,7 +26,7 @@ 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" + defaultconfig := "println green neOwOfetchh 🔥\ninfo white username\nprint blue @\ninfoln blue hostname\nprint white|space=12 uptime:\ninfoln red uptime\nprint white|space=12 shell:\ninfoln blue shell\nprint white|space=12 distro:\ninfoln blue distro\nprint white|space=12 terminal:\ninfoln blue terminal\nprint white|space=12 WM:\ninfoln blue wm\nprint white|space=12 memory:\ninfo blue memoryUsed\nprint white /\ninfoln blue memoryAll" if os.IsNotExist(file) { f, _ := os.Create(data.GetConfigFile()) _, _ = f.WriteString(defaultconfig) diff --git a/utils/printing.go b/utils/printing.go index 9cb7800..57e8d3c 100644 --- a/utils/printing.go +++ b/utils/printing.go @@ -142,6 +142,7 @@ func uwuify(message string) string { } type Format struct { + spaces int noUwuOverride bool colorFormat string oldcolorFormat int @@ -154,6 +155,10 @@ func parseFormat(format string) (parsedFormat Format) { if isColor && hascolor { parsedFormat.colorFormat += colorFormat } else { + if strings.HasPrefix(v, "space") { + parsedFormat.spaces, _ = strconv.Atoi(v[6:]) + return + } switch v { case "italic": parsedFormat.colorFormat += "\x1b[3m" @@ -190,8 +195,12 @@ func CutePrint( if willUwuify { message = uwuify(message) } + neededspaces := parsedFormat.spaces - len(message) + if neededspaces < 0 { + neededspaces = 0 + } if !colorold { - fmt.Printf("%s%s\x1b[0m", parsedFormat.colorFormat, message) + fmt.Printf("%s%s\x1b[0m%s", parsedFormat.colorFormat, message, strings.Repeat(" ", neededspaces)) } else { if os.IsNotExist(existcolorconf) { f, _ := os.Create(colorconf)