diff --git a/constants/constants.go b/constants/constants.go index 8b8cbd5..fabbf85 100644 --- a/constants/constants.go +++ b/constants/constants.go @@ -2,6 +2,8 @@ package constants const Defaultcolor = "red 255 38 116 \ngreen 16 210 117\nblue 104 174 212\nwhite 250 253 255" +//DO NOT YELL AT ME THAT THIS ISNT A CONST YOU CANT MAKE A CONST YOU FUCKER + var Color_map = map[string]string{ "black": "30", "red": "31", diff --git a/main.go b/main.go index ed89c9f..dd46626 100644 --- a/main.go +++ b/main.go @@ -3,6 +3,7 @@ package main import ( "io/ioutil" "os" + "os/exec" "path/filepath" "strconv" "strings" @@ -19,6 +20,16 @@ func checkforconfigfolder() { os.Mkdir(data.GetHome()+"/.config", os.ModePerm) } } +func getSubstring(s string, indices []int) string { + return string(s[indices[0]:indices[1]]) +} + +func parseshell(bruh string) string { + // https://www.youtube.com/watch?v=YPN0qhSyWy8 + cmd := bruh + " --version | grep -o -E \"([0-9]\\.?)*\" | head -n1" + out, _ := exec.Command("bash", "-c", cmd).Output() + return bruh + " " + strings.ReplaceAll(string(out), "\n", "") +} func handleConfig() { _, folder := os.Stat(filepath.Dir(data.GetConfigFile())) @@ -75,7 +86,7 @@ func handlePrint(action, format string, rest string) { case "GPU": utils.CutePrint(data.GetGPU(), format) case "shell": - utils.CutePrint(data.GetShell(), format) + utils.CutePrint(parseshell(data.GetShell()), format) case "terminal": utils.CutePrint(data.GetTerminal(), format) case "memoryAll":