From df4554955832599714f6cf77c40055ebaa85aac1 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 23 Feb 2024 22:07:57 -0600 Subject: [PATCH] goimport auto syntax change --- color.go | 29 +++++++++++++++++++++++++++++ xterm.go | 20 ++++++++++---------- 2 files changed, 39 insertions(+), 10 deletions(-) create mode 100644 color.go 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