From 4c723d8bc87b4e8877e340356f71a4a89611434c Mon Sep 17 00:00:00 2001 From: Wanjohi <71614375+wanjohiryan@users.noreply.github.com> Date: Sun, 2 Jun 2024 00:59:56 +0300 Subject: [PATCH 1/6] =?UTF-8?q?=E2=9C=A8=20feat:=20Write=20cli=20executabl?= =?UTF-8?q?e=20as=20a=20go=20program.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- go.mod | 3 +++ main.go | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 go.mod create mode 100644 main.go diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..a927b75 --- /dev/null +++ b/go.mod @@ -0,0 +1,3 @@ +module github.com/netrisdotme/cli + +go 1.22.2 diff --git a/main.go b/main.go new file mode 100644 index 0000000..87ada5b --- /dev/null +++ b/main.go @@ -0,0 +1,23 @@ +package main + +import ( + "fmt" + "runtime" +) + +func main() { + + switch runtime.GOOS { + case "windows": + //This is where we should build our nestri "nest" + fmt.Println("You're on Windows!") + case "darwin": + //do nothing (probably deploy to AWS, Vast.ai and the rest) plus Linux & Windows + fmt.Println("You're on macOS!") + case "linux": + //This is where we should build our nestri "server" + fmt.Println("You're on Linux!") + default: + fmt.Printf("Unsupported operating system: %s\n", runtime.GOOS) + } +} From a61c44bfe86157ad8fc0180e8890793ce8d9713a Mon Sep 17 00:00:00 2001 From: Wanjohi <71614375+wanjohiryan@users.noreply.github.com> Date: Mon, 3 Jun 2024 00:33:51 +0300 Subject: [PATCH 2/6] feat: Add neofetch with ASCII command --- LICENSE | 21 ---------- cmd/nestri.ascii | 22 +++++++++++ cmd/root.go | 101 +++++++++++++++++++++++++++++++++++++++++++++++ go.mod | 15 +++++++ go.sum | 30 ++++++++++++++ main.go | 24 +++-------- 6 files changed, 174 insertions(+), 39 deletions(-) create mode 100644 cmd/nestri.ascii create mode 100644 cmd/root.go create mode 100644 go.sum diff --git a/LICENSE b/LICENSE index 2cf54b1..e69de29 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2024 netris - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/cmd/nestri.ascii b/cmd/nestri.ascii new file mode 100644 index 0000000..2cdd77c --- /dev/null +++ b/cmd/nestri.ascii @@ -0,0 +1,22 @@ + :*@@@@@*- + +@@@@@@@@@@#=. + :@@@@@@@@@@@@@@%+: + .:--. .#@@@@:.=*@@@@@@@@@*- + -%@@@@@@*-. .=#@. :+#@@@@@@@@#+. +*@@@@@@@@@@@%+: .=#@@@@@@@@%= +@@@@@@#@@@@@@@@@*-. -*@@@@@@@* +@@@@@* :+%@@@@@@@@%+: +@@@@@@ +@@@@@+ -#@@@@@@@@@*. :+@@@@@@@* +@@@@@+ -+%@@@*=. .=*@@@@@@@@%= +@@@@@+ :*=. :+%@@@@@@@@#=. +@@@@@+ -@@@%- +@@@@@@@@@#- +@@@@@+ -@@@@@ @@@@@@%*- -*%%*. +@@@@@* -@@@@@: @@@#=. +@@@@@@@= +@@@@@* . -@@@@@: +: .+@@@@@@ +@@@@@#=*%* -@@@@@- :+@@@@@@% +%@@@@@@@@+ -@@@@@- .-*@@@@@@@@#. +.*@@@@@@@+ -@@@@@- .+%@@@@@@@@%+. + .=+**+- :@@@@@= .-*%@@@@@@@@#=. + :@@@@@%%@@@@@@@@%+- + %@@@@@@@@@@@#=. + .+%@@@@@%*- diff --git a/cmd/root.go b/cmd/root.go new file mode 100644 index 0000000..cc32534 --- /dev/null +++ b/cmd/root.go @@ -0,0 +1,101 @@ +/* +Copyright © 2024 Nestri <> +*/ +package cmd + +import ( + _ "embed" + "fmt" + "os" + "strings" + + "github.com/charmbracelet/lipgloss" + "github.com/muesli/termenv" + "github.com/spf13/cobra" +) + +//go:embed nestri.ascii +var art string + +// rootCmd represents the base command when called without any subcommands +var rootCmd = &cobra.Command{ + Use: "nestri", + Short: "A CLI tool to manage your cloud gaming service", + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) error { + return cmd.Help() + }, +} + +var neoFetchCmd = &cobra.Command{ + Use: "neofetch", + Short: "Show important system information", + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) error { + lipgloss.SetColorProfile(termenv.TrueColor) + + var ( + b strings.Builder + lines = strings.Split(art, "\n") + colors = []string{"#F8481C", "#F74127", "#F53B30", "#F23538", "#F02E40"} + step = len(lines) / len(colors) + ) + + for i, l := range lines { + n := clamp(0, len(colors)-1, i/step) + b.WriteString(colorize(colors[n], l)) + b.WriteRune('\n') + } + + fmt.Print(b.String()) + + return nil + }, +} + +// Execute adds all child commands to the root command and sets flags appropriately. +// This is called by main.main(). It only needs to happen once to the rootCmd. +func Execute() { + err := rootCmd.Execute() + if err != nil { + os.Exit(1) + } +} + +func init() { + // Here you will define your flags and configuration settings. + // Cobra supports persistent flags, which, if defined here, + // will be global for your application. + rootCmd.AddCommand(neoFetchCmd) + + // rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.cli.yaml)") + + // Cobra also supports local flags, which will only run + // when this action is called directly. + rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle") +} + +func colorize(c, s string) string { + return lipgloss.NewStyle().Foreground(lipgloss.Color(c)).Render(s) +} + +func clamp(v, low, high int) int { + if high < low { + low, high = high, low + } + return min(high, max(low, v)) +} + +func min(a, b int) int { + if a < b { + return a + } + return b +} + +func max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/go.mod b/go.mod index a927b75..e9a3cb2 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,18 @@ module github.com/netrisdotme/cli go 1.22.2 + +require ( + github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect + github.com/charmbracelet/lipgloss v0.11.0 // indirect + github.com/charmbracelet/x/ansi v0.1.1 // indirect + github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/lucasb-eyer/go-colorful v1.2.0 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mattn/go-runewidth v0.0.15 // indirect + github.com/muesli/termenv v0.15.2 // indirect + github.com/rivo/uniseg v0.4.7 // indirect + github.com/spf13/cobra v1.8.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + golang.org/x/sys v0.19.0 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..71a2ea9 --- /dev/null +++ b/go.sum @@ -0,0 +1,30 @@ +github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k= +github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= +github.com/charmbracelet/lipgloss v0.11.0 h1:UoAcbQ6Qml8hDwSWs0Y1cB5TEQuZkDPH/ZqwWWYTG4g= +github.com/charmbracelet/lipgloss v0.11.0/go.mod h1:1UdRTH9gYgpcdNN5oBtjbu/IzNKtzVtb7sqN1t9LNn8= +github.com/charmbracelet/x/ansi v0.1.1 h1:CGAduulr6egay/YVbGc8Hsu8deMg1xZ/bkaXTPi1JDk= +github.com/charmbracelet/x/ansi v0.1.1/go.mod h1:dk73KoMTT5AX5BsX0KrqhsTqAnhZZoCBjs7dGWp4Ktw= +github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY= +github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= +github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo= +github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8= +github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= +github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= +github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/main.go b/main.go index 87ada5b..92e8c0b 100644 --- a/main.go +++ b/main.go @@ -1,23 +1,11 @@ +/* +Copyright © 2024 NAME HERE + +*/ package main -import ( - "fmt" - "runtime" -) +import "github.com/netrisdotme/cli/cmd" func main() { - - switch runtime.GOOS { - case "windows": - //This is where we should build our nestri "nest" - fmt.Println("You're on Windows!") - case "darwin": - //do nothing (probably deploy to AWS, Vast.ai and the rest) plus Linux & Windows - fmt.Println("You're on macOS!") - case "linux": - //This is where we should build our nestri "server" - fmt.Println("You're on Linux!") - default: - fmt.Printf("Unsupported operating system: %s\n", runtime.GOOS) - } + cmd.Execute() } From 017c6c6b0d29092cbe25f34cc0e9472d5379fe74 Mon Sep 17 00:00:00 2001 From: Wanjohi <71614375+wanjohiryan@users.noreply.github.com> Date: Tue, 4 Jun 2024 02:18:21 +0300 Subject: [PATCH 3/6] feat: Add padding --- cmd/root.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/cmd/root.go b/cmd/root.go index cc32534..9aaefdb 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -10,6 +10,7 @@ import ( "strings" "github.com/charmbracelet/lipgloss" + "github.com/charmbracelet/lipgloss/table" "github.com/muesli/termenv" "github.com/spf13/cobra" ) @@ -34,6 +35,12 @@ var neoFetchCmd = &cobra.Command{ RunE: func(cmd *cobra.Command, args []string) error { lipgloss.SetColorProfile(termenv.TrueColor) + baseStyle := lipgloss.NewStyle(). + PaddingTop(1). + PaddingRight(4). + PaddingBottom(1). + PaddingLeft(4) + var ( b strings.Builder lines = strings.Split(art, "\n") @@ -47,7 +54,12 @@ var neoFetchCmd = &cobra.Command{ b.WriteRune('\n') } - fmt.Print(b.String()) + t := table.New(). + Border(lipgloss.HiddenBorder()) + + t.Row(baseStyle.Render(b.String()), baseStyle.Render("System Info goes here")) + + fmt.Print(t) return nil }, From 852478c784fb172f20fd7a4340ba1774e6df2ade Mon Sep 17 00:00:00 2001 From: Wanjohi <71614375+wanjohiryan@users.noreply.github.com> Date: Tue, 4 Jun 2024 03:55:49 +0300 Subject: [PATCH 4/6] feat: Add specs generator --- cmd/root.go | 41 +++++++++++++++++++----- pkg/specs/system.go | 76 +++++++++++++++++++++++++++++++++++++++++++++ pkg/specs/types.go | 14 +++++++++ 3 files changed, 124 insertions(+), 7 deletions(-) create mode 100644 pkg/specs/system.go create mode 100644 pkg/specs/types.go diff --git a/cmd/root.go b/cmd/root.go index 9aaefdb..80fbcaf 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -8,6 +8,9 @@ import ( "fmt" "os" "strings" + "sync" + + "github.com/netrisdotme/cli/pkg/specs" "github.com/charmbracelet/lipgloss" "github.com/charmbracelet/lipgloss/table" @@ -35,11 +38,11 @@ var neoFetchCmd = &cobra.Command{ RunE: func(cmd *cobra.Command, args []string) error { lipgloss.SetColorProfile(termenv.TrueColor) - baseStyle := lipgloss.NewStyle(). - PaddingTop(1). - PaddingRight(4). - PaddingBottom(1). - PaddingLeft(4) + // baseStyle := lipgloss.NewStyle(). + // MarginTop(1). + // MarginRight(4). + // MarginBottom(1). + // MarginLeft(4) var ( b strings.Builder @@ -55,9 +58,17 @@ var neoFetchCmd = &cobra.Command{ } t := table.New(). - Border(lipgloss.HiddenBorder()) + Border(lipgloss.HiddenBorder()).BorderStyle(lipgloss.NewStyle().Width(3)) + + info := &specs.Specs{} + infoChan := make(chan specs.Specs, 1) + var wg sync.WaitGroup + wg.Add(1) + go getSpecs(info, infoChan, &wg) + wg.Wait() + newInfo := <-infoChan - t.Row(baseStyle.Render(b.String()), baseStyle.Render("System Info goes here")) + t.Row(b.String(), newInfo.GPU) fmt.Print(t) @@ -111,3 +122,19 @@ func max(a, b int) int { } return b } + +func getSpecs(info *specs.Specs, infoChan chan specs.Specs, wg *sync.WaitGroup) { + defer wg.Done() + sys := specs.New() + // info.Userhost = getUserHostname() + // info.OS = getOSName() + // info.Kernel = getKernelVersion() + // info.Uptime = getUptime() + // info.Shell = getShell() + // info.CPU = getCPUName() + // info.RAM = getMemStats() + info.GPU, _ = sys.GetGPUInfo() + // info.SystemArch, _ = getSystemArch() + // info.DiskUsage, _ = getDiskUsage() + infoChan <- *info +} diff --git a/pkg/specs/system.go b/pkg/specs/system.go new file mode 100644 index 0000000..ff96837 --- /dev/null +++ b/pkg/specs/system.go @@ -0,0 +1,76 @@ +package specs + +import ( + "fmt" + "os/exec" + "runtime" + "strings" +) + +type SysSpecs struct { + osx string +} + +func New() *SysSpecs { + return &SysSpecs{osx: runtime.GOOS} +} + +func (s SysSpecs) GetGPUInfo() (string, error) { + var output []byte + var err error + + switch s.osx { + case "windows": + output, err = exec.Command("wmic", "path", "win32_VideoController", "get", "name").Output() + if err != nil { + return "", fmt.Errorf("error retrieving GPU information on Windows: %v", err) + } + case "darwin": + output, err = exec.Command("system_profiler", "SPDisplaysDataType").Output() + if err != nil { + return "", fmt.Errorf("error retrieving GPU information on macOS: %v", err) + } + case "linux": + output, err = exec.Command("lspci", "-vnn").Output() + if err != nil { + return "", fmt.Errorf("error retrieving GPU information on Linux: %v", err) + } + default: + return "", fmt.Errorf("error: GPU information retrieval not implemented for %s", runtime.GOOS) + } + + outputStr := strings.TrimSpace(string(output)) + + if s.osx == "windows" { + lines := strings.Split(outputStr, "\r\n")[1:] + gpuName := strings.TrimSpace(strings.Join(lines, " ")) + return gpuName, nil + } + + if s.osx == "darwin" { + lines := strings.Split(outputStr, "\n") + for _, line := range lines { + if strings.Contains(line, "Chipset Model:") { + fields := strings.Split(line, ":") + if len(fields) >= 2 { + gpuName := strings.TrimSpace(fields[1]) + return gpuName, nil + } + } + } + return "", fmt.Errorf("error parsing GPU information on macOS") + } + + lines := strings.Split(outputStr, "\n") + + for _, line := range lines { + if strings.Contains(line, "VGA compatible controller") { + fields := strings.Fields(line) + if len(fields) > 2 { + gpuName := strings.Join(fields[2:], " ") + return gpuName, nil + } + } + } + return "", fmt.Errorf("error parsing GPU information on Linux") +} diff --git a/pkg/specs/types.go b/pkg/specs/types.go new file mode 100644 index 0000000..0fa1bdf --- /dev/null +++ b/pkg/specs/types.go @@ -0,0 +1,14 @@ +package specs + +type Specs struct { + Userhost string + OS string + Kernel string + Uptime string + Shell string + CPU string + RAM string + GPU string + SystemArch string + DiskUsage string +} From d5eda74cc381328311a7952ddcb77634f30b19ba Mon Sep 17 00:00:00 2001 From: Wanjohi Ryan <71614375+wanjohiryan@users.noreply.github.com> Date: Tue, 25 Jun 2024 03:35:26 +0300 Subject: [PATCH 5/6] fix: change logo --- cmd/nestri.ascii | 42 ++++++++++++++++++++---------------------- cmd/root.go | 4 ++-- go.mod | 2 +- main.go | 2 +- 4 files changed, 24 insertions(+), 26 deletions(-) diff --git a/cmd/nestri.ascii b/cmd/nestri.ascii index 2cdd77c..9d6d5b8 100644 --- a/cmd/nestri.ascii +++ b/cmd/nestri.ascii @@ -1,22 +1,20 @@ - :*@@@@@*- - +@@@@@@@@@@#=. - :@@@@@@@@@@@@@@%+: - .:--. .#@@@@:.=*@@@@@@@@@*- - -%@@@@@@*-. .=#@. :+#@@@@@@@@#+. -*@@@@@@@@@@@%+: .=#@@@@@@@@%= -@@@@@@#@@@@@@@@@*-. -*@@@@@@@* -@@@@@* :+%@@@@@@@@%+: +@@@@@@ -@@@@@+ -#@@@@@@@@@*. :+@@@@@@@* -@@@@@+ -+%@@@*=. .=*@@@@@@@@%= -@@@@@+ :*=. :+%@@@@@@@@#=. -@@@@@+ -@@@%- +@@@@@@@@@#- -@@@@@+ -@@@@@ @@@@@@%*- -*%%*. -@@@@@* -@@@@@: @@@#=. +@@@@@@@= -@@@@@* . -@@@@@: +: .+@@@@@@ -@@@@@#=*%* -@@@@@- :+@@@@@@% -%@@@@@@@@+ -@@@@@- .-*@@@@@@@@#. -.*@@@@@@@+ -@@@@@- .+%@@@@@@@@%+. - .=+**+- :@@@@@= .-*%@@@@@@@@#=. - :@@@@@%%@@@@@@@@%+- - %@@@@@@@@@@@#=. - .+%@@@@@%*- +************************************************** +################################################## +################################################## +################################################## +################################################## +:::::::::::::::::::::::::::::::::::::::::::::::::: + +************************************************** +################################################## +################################################## +################################################## +################################################## +:::::::::::::::::::::::::::::::::::::::::::::::::: + +************************************************** +################################################## +################################################## +################################################## +################################################## +:::::::::::::::::::::::::::::::::::::::::::::::::: diff --git a/cmd/root.go b/cmd/root.go index 80fbcaf..e20b428 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -10,7 +10,7 @@ import ( "strings" "sync" - "github.com/netrisdotme/cli/pkg/specs" + "github.com/nestriness/cli/pkg/specs" "github.com/charmbracelet/lipgloss" "github.com/charmbracelet/lipgloss/table" @@ -47,7 +47,7 @@ var neoFetchCmd = &cobra.Command{ var ( b strings.Builder lines = strings.Split(art, "\n") - colors = []string{"#F8481C", "#F74127", "#F53B30", "#F23538", "#F02E40"} + colors = []string{"#CC3D00", "#CC3D00"} step = len(lines) / len(colors) ) diff --git a/go.mod b/go.mod index e9a3cb2..76bdebf 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/netrisdotme/cli +module github.com/nestriness/cli go 1.22.2 diff --git a/main.go b/main.go index 92e8c0b..a223a10 100644 --- a/main.go +++ b/main.go @@ -4,7 +4,7 @@ Copyright © 2024 NAME HERE */ package main -import "github.com/netrisdotme/cli/cmd" +import "github.com/nestriness/cli/cmd" func main() { cmd.Execute() From 50914820f14a21e5f0b5da84ba3884f3235ac382 Mon Sep 17 00:00:00 2001 From: Wanjohi Ryan <71614375+wanjohiryan@users.noreply.github.com> Date: Tue, 25 Jun 2024 03:39:34 +0300 Subject: [PATCH 6/6] chore: Add a FIXME --- cmd/root.go | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index e20b428..653ef68 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -59,16 +59,16 @@ var neoFetchCmd = &cobra.Command{ t := table.New(). Border(lipgloss.HiddenBorder()).BorderStyle(lipgloss.NewStyle().Width(3)) - - info := &specs.Specs{} - infoChan := make(chan specs.Specs, 1) - var wg sync.WaitGroup - wg.Add(1) - go getSpecs(info, infoChan, &wg) - wg.Wait() - newInfo := <-infoChan - - t.Row(b.String(), newInfo.GPU) + //TODO: show this specs + // info := &specs.Specs{} + // infoChan := make(chan specs.Specs, 1) + // var wg sync.WaitGroup + // wg.Add(1) + // go getSpecs(info, infoChan, &wg) + // wg.Wait() + // newInfo := <-infoChan + + t.Row(b.String()) fmt.Print(t)