what have i created

This commit is contained in:
echo 2022-12-15 02:18:42 +03:30
parent aa37b9033a
commit 769102da79
2 changed files with 14 additions and 1 deletions

View file

@ -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",

13
main.go
View file

@ -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":