From 9909241c1ff4758c4090398eea4536edd486b761 Mon Sep 17 00:00:00 2001 From: echo <91651232+exhq@users.noreply.github.com> Date: Mon, 26 Sep 2022 11:55:16 +0330 Subject: [PATCH] what --- PKGBUILD | 22 +++++++ README.md | 36 +++++++++++- asciiarts/asciiart.go | 6 +- asciiarts/windows.txt | 1 + data/data.go | 130 ++++++++++++++++++++++++++++++++++++++++++ utils/asciiarts.go | 128 ----------------------------------------- 6 files changed, 193 insertions(+), 130 deletions(-) create mode 100644 PKGBUILD create mode 100644 asciiarts/windows.txt delete mode 100644 utils/asciiarts.go diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..56a48a6 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,22 @@ +pkgbase=neowofetch-git +pkgname=$pkgbase +pkgver=r539.084603b +pkgrel=1 +depends=(go) +arch=(x86_64) +source=("git+https://github.com/exhq/neOWOfetch.git") +sha256sums=('SKIP') + +pkgver() { + cd $srcdir/neOWOfetch + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +build() { + cd $srcdir/neOWOfetch + go build go.main +} + +package() { + install -Dm755 $srcdir/neOWOfetch/neowofetch $pkgdir/usr/bin/neowofetch +} diff --git a/README.md b/README.md index 3d99a81..ad1af29 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,40 @@ You can further configure NeOwOfetch to your horrible taste. Through the use of NeOwOfetch supports almost like 2 different operating systems. From Linux to Linux. If your favourite operating system is unsupported i dont give a shit, ill get to it when i get to it. for now its just arch and ubuntu +
jokes aside, the asciiarts are from uwufetch, all credits go to them.
\ No newline at end of file diff --git a/asciiarts/asciiart.go b/asciiarts/asciiart.go index 39fa1d3..3558482 100644 --- a/asciiarts/asciiart.go +++ b/asciiarts/asciiart.go @@ -92,6 +92,9 @@ var void string //go:embed xerolinux.txt var xerolinux string +//go:embed windows.txt +var windows string + func GetAsciiInternal(distroID string) string { switch distroID { case "alpine": @@ -147,7 +150,8 @@ func GetAsciiInternal(distroID string) string { case "arch": return arch - + case "windows": + return windows default: return unknown } diff --git a/asciiarts/windows.txt b/asciiarts/windows.txt new file mode 100644 index 0000000..ee2629e --- /dev/null +++ b/asciiarts/windows.txt @@ -0,0 +1 @@ +FUCK YOU \ No newline at end of file diff --git a/data/data.go b/data/data.go index 35192d5..70f3aff 100644 --- a/data/data.go +++ b/data/data.go @@ -3,12 +3,102 @@ package data import ( "fmt" "os" + "os/exec" + "strconv" "strings" ) +func GetGPU() string { + cmd := exec.Command("lspci", "-v") + shell, err := cmd.Output() + _ = err + var bruh string + //return strings.Replace(string(shell), "\n", "", -1) + //return string(shell) + for _, line := range strings.Split(strings.TrimSuffix(string(shell), "\n"), "\n") { + if strings.Contains(line, "VGA") { + bruh += line[strings.Index(line, ": ")+2 : strings.Index(line, " (")] + } + } + return bruh +} + +func GetUsername() string { + cmd := exec.Command("whoami") + shell, _ := cmd.Output() + return strings.Replace(string(shell), "\n", "", -1) +} + +func GetUptime() string { + content, _ := os.ReadFile("/proc/uptime") + return (string(content[0:strings.Index(string(content), ".")])) + +} + +func GetKernel() string { + cmd := exec.Command("uname", "-r") + kernel, err := cmd.Output() + if err != nil { + fmt.Println(err.Error()) + return "fuck you" + } + return string(kernel) +} + +func GetHostname() string { + cmd := exec.Command("uname", "-n") + shell, _ := cmd.Output() + return strings.Replace(string(shell), "\n", "", -1) +} + func GetDistro() string { return GetDistroVariable("PRETTY_NAME") } +func GetMemory(used bool) string { + + // + // The coolest part about this function unlike neofetch is that it also takes account of the basic os operations + // into account thus not giving an illusion that your os is completely having fun + // honestly idk lmao + // + + mem, err := os.Open("/proc/meminfo") + if err != nil { + fmt.Println(err.Error()) + os.Exit(0) + } + 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) + for _, v := range mem_list { + if strings.Contains(v, ":") { + kv := strings.Split(v, ":") + kv[0] = strings.TrimSpace(kv[0]) + kv[1] = strings.TrimSpace(kv[1]) + kv[1] = strings.Replace(kv[1], "kB", "", 3) + kv[1] = strings.TrimSpace(kv[1]) + mem_map[kv[0]] = kv[1] + } + } + mem_free, _ := strconv.Atoi(mem_map["MemFree"]) + mem_total, _ := strconv.Atoi(mem_map["MemTotal"]) + mem_used := mem_total - mem_free + //memory := fmt.Sprintf("%d/%d", mem_used/1024, mem_total/1024) + if used { + return strconv.Itoa(mem_used / 1024) + } else { + return strconv.Itoa(mem_total / 1024) + } +} +func GetHome() string { + return os.Getenv("HOME") + +} +func GetConfigFile() string { + return GetHome() + "/.config/neowofetch/conf" +} func GetDistroVariable(varname string) string { distro, err := os.ReadFile("/etc/os-release") if err != nil { @@ -27,3 +117,43 @@ func GetDistroVariable(varname string) string { } return strings.Trim(distro_tuples[varname], "\"") } +func FormatTime(seconds int) string { + minutes := seconds / 60 + secondsre := strconv.Itoa(seconds % 60) + hour := strconv.Itoa(minutes / 60) + minutesre := strconv.Itoa(minutes % 60) + return (hour + "h " + minutesre + "m " + secondsre + "s") +} +func GetCPU() { + mem, _ := os.Open("/proc/cpuinfo") + 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 { + a, existprgm := os.LookupEnv("TERM_PROGRAM") + if !existprgm { + return os.Getenv("TERM") + } else { + return a + } + +} +func GetShell() string { + return os.Getenv("SHELL") +} +func getPackages() { +} +func getResolution() { +} +func getWM() { +} +func getTheme() { +} +func getIcons() { +} +func getColorPalette() { +} diff --git a/utils/asciiarts.go b/utils/asciiarts.go deleted file mode 100644 index 1f0fd79..0000000 --- a/utils/asciiarts.go +++ /dev/null @@ -1,128 +0,0 @@ -package utils - -func Getascii(name string) string { - - switch name { - case "alphine": - return `. .___. - / \/ \ / - /OωO\ɛU\/ __ - / \ \__/ \ -/ \ \` - case "amogos": - return ` ▄▄▄▄▄▄▄ - █ ▄▄▄▄▄ █ - ▐ █▄▄▄█ █ - ▌ ▐ - ▐ ▐ - █ ▐ - ▐ ▐▀▀▀▀█ ▐ - ▐▀▀▀ ▐ ▐ ▐ - ▀▀▀▀▀▀ █▀▀▀ █ - ▀▀▀▀▀▀ ` - case "android": - return ` \ _------_ / - / \ - | ~ > ω < ~ | - ------------ - - - ` - case "arcolinux": - return ` /\ - / \ - / \ - /O vv O\ - / / \ \ - / / __\ \ - /__/ \___\` - case "artix": - return ` /\ - / \ - /''.,\ - /• w • \ - / ,'\ - / ,.''. \ - /.,'' ''.\ - ` - case "debian": - return ` ______ - / ___ \ - | / OωO | - | \____- - -_ - --_\ - - ` - case "endeavouros": - return ` /\ - // \\ - //>ω<\\ - // \ \ - / / _) ) - /_/___-- ___- - /____---` - case "fedora": - return ` _____ - / __)\ - > | / <\ \ - ___| ω|__/ / - / (_ _)_/ - / / | | - \ \__/ | - \(_____/ - ` - case "freebsd": - return ` - /\,-'''''-,/\ - \_) (_/ - | \ / | - | O ω O | - ; ; - '-_____-' - ` - case "gentoo": - return ` _-----_ - ( \\ - \\ OωO \\ - \\ ) - / _/ - ( _- - \\____- - ` - case "guix": - return ` ,= ,-_-. =. - ((_/)U U(\_)) - '-'(. .)'-' - \w/ - ¯` - case "ios": - return ` WHY THE FUCK - ARE YOU USING IOS - PIECE OF FUCKING SHIT` - case "arch": - return ` /\ - / \ - /\ \ - / > ω <\ - / __ \ - / __| |__-\ -/_-'' ''-_\ - ` - case "linuxmint": - return ` /\______/\. - |.--. | - , ¯| | UωU| | -|| | | | | - | | ---- | - --'--------'` - - default: - return `!!!!!!!!!!!!!!! -!!!!!!!!!!!!!!! -!!!!noascii!!!! -!!!!!!!!!!!!!!! -!!!!!!!!!!!!!!! ` - } - -}