diff --git a/color.go b/color.go new file mode 100644 index 0000000..fb2ee89 --- /dev/null +++ b/color.go @@ -0,0 +1,29 @@ +package shell + +import ( + "fmt" +) + +func get_terminal_color_palette() string { + // var runes rune + // color1 := "\x1b[0;29m  \x1b[0m" + // runes = []rune(color1) + // view.WriteRunes(runes) + + color1 := "\x1b[0;29m  \x1b[0m" + color2 := "\x1b[0;31m  \x1b[0m" + color3 := "\x1b[0;32m  \x1b[0m" + color4 := "\x1b[0;33m  \x1b[0m" + color5 := "\x1b[0;34m  \x1b[0m" + color6 := "\x1b[0;35m  \x1b[0m" + color7 := "\x1b[0;36m  \x1b[0m" + color8 := "\x1b[0;37m  \x1b[0m" + + return color1 + " " + color2 + " " + color3 + " " + color4 + " " + color5 + " " + color6 + " " + color7 + " " + color8 +} + +// what genius figured this out? +// originally from github.com/dimasma0305/GoFetch +func TestTerminalColor() { + fmt.Println(get_terminal_color_palette()) +} diff --git a/xterm.go b/xterm.go index d51cc96..b06ef33 100644 --- a/xterm.go +++ b/xterm.go @@ -59,17 +59,17 @@ func Terminal() string { pid := os.Getpid() _, comm := scanToParent(pid) /* - ppid, err := GetPPID(pid) - if err != nil { - fmt.Println("Error getting PPID:", err) - return "" - } + ppid, err := GetPPID(pid) + if err != nil { + fmt.Println("Error getting PPID:", err) + return "" + } - comm, err := GetComm(ppid) - if err != nil { - fmt.Println("Error getting comm:", err) - return "" - } + comm, err := GetComm(ppid) + if err != nil { + fmt.Println("Error getting comm:", err) + return "" + } */ return comm