what have i created
This commit is contained in:
parent
aa37b9033a
commit
769102da79
2 changed files with 14 additions and 1 deletions
|
@ -2,6 +2,8 @@ package constants
|
||||||
|
|
||||||
const Defaultcolor = "red 255 38 116 \ngreen 16 210 117\nblue 104 174 212\nwhite 250 253 255"
|
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{
|
var Color_map = map[string]string{
|
||||||
"black": "30",
|
"black": "30",
|
||||||
"red": "31",
|
"red": "31",
|
||||||
|
|
13
main.go
13
main.go
|
@ -3,6 +3,7 @@ package main
|
||||||
import (
|
import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
|
"os/exec"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
@ -19,6 +20,16 @@ func checkforconfigfolder() {
|
||||||
os.Mkdir(data.GetHome()+"/.config", os.ModePerm)
|
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() {
|
func handleConfig() {
|
||||||
_, folder := os.Stat(filepath.Dir(data.GetConfigFile()))
|
_, folder := os.Stat(filepath.Dir(data.GetConfigFile()))
|
||||||
|
@ -75,7 +86,7 @@ func handlePrint(action, format string, rest string) {
|
||||||
case "GPU":
|
case "GPU":
|
||||||
utils.CutePrint(data.GetGPU(), format)
|
utils.CutePrint(data.GetGPU(), format)
|
||||||
case "shell":
|
case "shell":
|
||||||
utils.CutePrint(data.GetShell(), format)
|
utils.CutePrint(parseshell(data.GetShell()), format)
|
||||||
case "terminal":
|
case "terminal":
|
||||||
utils.CutePrint(data.GetTerminal(), format)
|
utils.CutePrint(data.GetTerminal(), format)
|
||||||
case "memoryAll":
|
case "memoryAll":
|
||||||
|
|
Loading…
Reference in a new issue