thats a great README file honey where did you get that from

This commit is contained in:
echo 2022-09-23 12:33:50 +03:30
parent 5d4761e499
commit 85c04bc13b
7 changed files with 47 additions and 49 deletions

View file

@ -1 +1,6 @@
in beta or something idk <h1 align="center">neOwOfetch</h1> <p align="center">imagine neofetch, but OwO
<p align="center">
<a href="./LICENSE.md"><img src="https://cdn.discordapp.com/attachments/832652653292027904/1022794924078415932/idfk.png"></a>
<a href="https://github.com/dylanaraps/neofetch/releases"><img src="https://cdn.discordapp.com/attachments/832652653292027904/1022794924439113808/neoowowoowow.png"></a>
<a href="https://repology.org/metapackage/neofetch"><img src="https://cdn.discordapp.com/attachments/832652653292027904/1022794924783050782/bruh.png" alt="Packaging status"></a>
</p>

BIN
arch.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 139 KiB

9
go.mod
View file

@ -1,10 +1,3 @@
module github.com/exhq/neowofetch module github.com/exhq/neowofetch
go 1.19 go 1.19
require (
github.com/fatih/color v1.13.0
github.com/mattn/go-colorable v0.1.9 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c // indirect
)

11
go.sum
View file

@ -1,11 +0,0 @@
github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
github.com/mattn/go-colorable v0.1.9 h1:sqDoxXbdeALODt0DAeJCVp38ps9ZogZEAXjus69YV3U=
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y=
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c h1:F1jZWGFhYfh0Ci55sIpILtKKK8p3i2/krTr0H1rg74I=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=

View file

@ -213,6 +213,7 @@ func getColorPalette() {
func main() { func main() {
utils.Initargs() utils.Initargs()
utils.Initcolor()
utils.CutePrintInit() utils.CutePrintInit()
handleConfig() handleConfig()
utils.CutePrintEnd() utils.CutePrintEnd()

View file

@ -9,6 +9,7 @@ var args []string
var shoulduwuify bool = true var shoulduwuify bool = true
var noascii bool = false var noascii bool = false
var usepng bool = false var usepng bool = false
var hascolor bool = true
func Initargs() { func Initargs() {
args = os.Args[1:] args = os.Args[1:]
@ -21,6 +22,8 @@ func Initargs() {
noascii = true noascii = true
case "--usepng": case "--usepng":
usepng = true usepng = true
case "--nocolor":
hascolor = false
} }
} }
} }

View file

@ -3,8 +3,9 @@ package utils
import ( import (
"encoding/base64" "encoding/base64"
"fmt" "fmt"
"math/rand"
"os" "os"
"path/filepath"
"strconv"
"strings" "strings"
"github.com/exhq/neowofetch/data" "github.com/exhq/neowofetch/data"
@ -15,29 +16,8 @@ func rgb(r, g, b int) string {
return fmt.Sprintf("\x1b[38:2::%d:%d:%dm", r, g, b) return fmt.Sprintf("\x1b[38:2::%d:%d:%dm", r, g, b)
} }
var colors = map[string]string{ var colors = make(map[string]string)
"green": rgb(0, 255, 0),
"blue": rgb(0, 0, 255),
"red": rgb(255, 0, 0),
}
var uwuEmotes = [15]string{
"owo",
"UwU",
">w<",
"^w^",
"●w●",
"☆w☆",
"𝗨𝘄𝗨",
"(´꒳`)",
"♥(。U ω U。)",
"(˘ε˘)",
"( ˘ᴗ˘ )",
"(*ฅ́˘ฅ̀*)",
"*screams*",
"*twerks*",
"*sweats*",
}
var logoIndex = 0 var logoIndex = 0
var isInProgressLine = false var isInProgressLine = false
var logoLines []string var logoLines []string
@ -47,6 +27,34 @@ var pngWidth = 12
var pngHeight = 12 var pngHeight = 12
var pngData []byte var pngData []byte
func Initcolor() {
colorconf := os.Getenv("HOME") + "/.config/neowofetch/colors"
folderconf := filepath.Dir(colorconf)
_, existcolorconf := os.Stat(colorconf)
_, existfolderconf := os.Stat(folderconf)
if os.IsNotExist(existfolderconf) {
os.Mkdir(folderconf, os.ModePerm)
}
if os.IsNotExist(existcolorconf) {
println("color was not found. a default config file has been generated in '~/.config/neowofetch/colors'. rerun the program")
f, _ := os.Create(colorconf)
_, _ = f.WriteString("red 255 0 0 \nblue 0 255 0\nred 0 0 255\nwhite 255 255 255")
os.Exit(0)
}
content, _ := os.ReadFile(colorconf)
lines := strings.Split(string(content), "\n")
for _, line := range lines {
word := strings.Split(line, " ")
R, _ := strconv.Atoi(word[1])
G, _ := strconv.Atoi(word[2])
B, _ := strconv.Atoi(word[3])
colors[word[0]] = rgb(R, G, B)
}
}
func CutePrintInit() { func CutePrintInit() {
dist := data.GetDistroVariable("ID") dist := data.GetDistroVariable("ID")
logo := Getascii(dist) logo := Getascii(dist)
@ -55,7 +63,7 @@ func CutePrintInit() {
} }
if usepng { if usepng {
pngData = images.DistroImages[dist] pngData = images.DistroImages[dist]
logo = strings.Repeat(" ", pngWidth) + strings.Repeat("\n", pngHeight) logo = strings.Repeat(" ", pngWidth) + " " + strings.Repeat("\n", pngHeight)
} }
logoLines = strings.Split(logo, "\n") logoLines = strings.Split(logo, "\n")
logoWidth = 0 logoWidth = 0
@ -111,7 +119,7 @@ type Format struct {
func parseFormat(format string) (parsedFormat Format) { func parseFormat(format string) (parsedFormat Format) {
for _, v := range strings.Split(format, "|") { for _, v := range strings.Split(format, "|") {
colorFormat, isColor := colors[v] colorFormat, isColor := colors[v]
if isColor { if isColor && hascolor {
parsedFormat.colorFormat += colorFormat parsedFormat.colorFormat += colorFormat
} else { } else {
switch v { switch v {
@ -123,7 +131,9 @@ func parseFormat(format string) (parsedFormat Format) {
parsedFormat.noUwuOverride = true parsedFormat.noUwuOverride = true
case "*": case "*":
default: default:
//println("Unknown format code: ", v) if hascolor {
println("Unknown format code: ", v)
}
} }
} }
} }
@ -145,9 +155,6 @@ func CutePrint(
func CuteNewLine() { func CuteNewLine() {
printLogoIfAtBeginningOfNewLine() printLogoIfAtBeginningOfNewLine()
if rand.Intn(5) == 0 && shoulduwuify {
fmt.Printf(" %s", uwuEmotes[rand.Intn(len(uwuEmotes))])
}
isInProgressLine = false isInProgressLine = false
fmt.Println() fmt.Println()
} }