what
This commit is contained in:
parent
0b28a01506
commit
9909241c1f
6 changed files with 193 additions and 130 deletions
22
PKGBUILD
Normal file
22
PKGBUILD
Normal file
|
@ -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
|
||||
}
|
36
README.md
36
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
|
||||
|
||||
<h1 align="center">how to use</h1>
|
||||
|
||||
after you decided that you have enough brain damage to use this mess, you can clone this repo (`git clone https://github.com/exhq/neowofetch`)
|
||||
|
||||
after cloning this mess, you can either run it (`go run main.go`) or install it (`go install main.go`) which will add it to your /usr/bin
|
||||
|
||||
|
||||
jokes aside, the asciiarts are from uwufetch, all credits go to them.
|
||||
<h1 align="center">customizibility</h1>
|
||||
|
||||
after running the program for the first time, there should be two files in `~/.config/neowofetch/`
|
||||
### conf file
|
||||
|
||||
`conf` is the layout of the information.
|
||||
the syntax is `print/info */bold/bold|blue info/text`
|
||||
|
||||
examples:
|
||||
`println italic|blue hello world` this would print an italic blue "hello world" that ends with a new line. (if you dont want the newline, replace `println` with `print`)
|
||||
|
||||
|
||||
`info bold|yellow|nouwu GPU` this would print out your GPU in a bold yellow color without uwuifying. NOTICE: not all fonts support bold/italic
|
||||
|
||||
### colors file
|
||||
|
||||
this file is pretty self explainatory, you can define your own colors in RGB which you can later use in your conf file
|
||||
example:
|
||||
blue 0 0 255
|
||||
|
||||
<h1 align="center">commandline arguments</h1>
|
||||
|
||||
`--noascii` turns the asciiart off
|
||||
`--usepng` uses png instead of asciiarts (still on beta)
|
||||
`ascii=<file dir>` uses your txt file as the ascii art
|
||||
`--distro=<distroname>` forced the program to use another distro's asciiart
|
||||
`--nouwu` turns off uwuifiation for all lines
|
||||
`--nocolor` i think you can figure out what this argument does
|
||||
|
||||
<p align="center">jokes aside, the asciiarts are from uwufetch, all credits go to them.</p>
|
|
@ -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
|
||||
}
|
||||
|
|
1
asciiarts/windows.txt
Normal file
1
asciiarts/windows.txt
Normal file
|
@ -0,0 +1 @@
|
|||
FUCK YOU
|
130
data/data.go
130
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() {
|
||||
}
|
||||
|
|
|
@ -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!!!!
|
||||
!!!!!!!!!!!!!!!
|
||||
!!!!!!!!!!!!!!! `
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue