diff --git a/asciiarts/archcraft.txt b/asciiarts/archcraft.txt new file mode 100644 index 0000000..2055997 --- /dev/null +++ b/asciiarts/archcraft.txt @@ -0,0 +1,7 @@ +{BLUE} /\ + / \ + /\ \ + / > ω <\ + / __ \ + / __| |__-\ + /_-'' ''-_\ diff --git a/asciiarts/arcolinux.txt b/asciiarts/arcolinux.txt index 307c35e..9992c67 100644 --- a/asciiarts/arcolinux.txt +++ b/asciiarts/arcolinux.txt @@ -1,7 +1,7 @@ -{BLUE} /\ - / \ - / \ - /{WHITE}O vv O{BLUE}\ +{BLUE} /\ + / \ + / \ + /{WHITE}O vv O{BLUE}\ / / \ \ - / / __\ \ + / / __\ \ /__/ `\___\ \ No newline at end of file diff --git a/data/data.go b/data/data.go index 9d1d1e7..a50a095 100644 --- a/data/data.go +++ b/data/data.go @@ -2,6 +2,7 @@ package data import ( "fmt" + "net" "os" "os/exec" "strconv" @@ -20,7 +21,21 @@ func GetGPU() string { } return bruh } - +func GetLocalIP() string { + addrs, err := net.InterfaceAddrs() + if err != nil { + return "" + } + for _, address := range addrs { + // check the address type and if it is not a loopback the display it + if ipnet, ok := address.(*net.IPNet); ok && !ipnet.IP.IsLoopback() { + if ipnet.IP.To4() != nil { + return ipnet.IP.String() + } + } + } + return "" +} func GetUsername() string { cmd := exec.Command("whoami") shell, _ := cmd.Output() @@ -126,8 +141,6 @@ func GetCPU() { mem_info := make([]byte, 1024) mem.Read(mem_info) mem.Close() - // mem_list := strings.Split(string(mem_info), "\n") - // mem_map := make(map[string]string) print(mem_info) } func GetTerminal() string { diff --git a/main.go b/main.go index 9f7d3ae..ed89c9f 100644 --- a/main.go +++ b/main.go @@ -84,6 +84,8 @@ func handlePrint(action, format string, rest string) { utils.CutePrint(data.GetMemory(true), format) case "wm": utils.CutePrint(data.GetWM(), format) + case "ip": + utils.CutePrint(data.GetLocalIP(), format) default: print("{UNKNOWN KEYWORD: " + rest + "}") }