thats a great README file honey where did you get that from
This commit is contained in:
parent
5d4761e499
commit
85c04bc13b
7 changed files with 47 additions and 49 deletions
|
@ -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
BIN
arch.png
Binary file not shown.
Before Width: | Height: | Size: 139 KiB |
9
go.mod
9
go.mod
|
@ -1,10 +1,3 @@
|
|||
module github.com/exhq/neowofetch
|
||||
|
||||
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
|
||||
)
|
||||
go 1.19
|
11
go.sum
11
go.sum
|
@ -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=
|
1
main.go
1
main.go
|
@ -213,6 +213,7 @@ func getColorPalette() {
|
|||
|
||||
func main() {
|
||||
utils.Initargs()
|
||||
utils.Initcolor()
|
||||
utils.CutePrintInit()
|
||||
handleConfig()
|
||||
utils.CutePrintEnd()
|
||||
|
|
|
@ -9,6 +9,7 @@ var args []string
|
|||
var shoulduwuify bool = true
|
||||
var noascii bool = false
|
||||
var usepng bool = false
|
||||
var hascolor bool = true
|
||||
|
||||
func Initargs() {
|
||||
args = os.Args[1:]
|
||||
|
@ -21,6 +22,8 @@ func Initargs() {
|
|||
noascii = true
|
||||
case "--usepng":
|
||||
usepng = true
|
||||
case "--nocolor":
|
||||
hascolor = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,8 +3,9 @@ package utils
|
|||
import (
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
"math/rand"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"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)
|
||||
}
|
||||
|
||||
var colors = map[string]string{
|
||||
"green": rgb(0, 255, 0),
|
||||
"blue": rgb(0, 0, 255),
|
||||
"red": rgb(255, 0, 0),
|
||||
}
|
||||
var colors = make(map[string]string)
|
||||
|
||||
var uwuEmotes = [15]string{
|
||||
"owo",
|
||||
"UwU",
|
||||
">w<",
|
||||
"^w^",
|
||||
"●w●",
|
||||
"☆w☆",
|
||||
"𝗨𝘄𝗨",
|
||||
"(´꒳`)",
|
||||
"♥(。U ω U。)",
|
||||
"(˘ε˘)",
|
||||
"( ˘ᴗ˘ )",
|
||||
"(*ฅ́˘ฅ̀*)",
|
||||
"*screams*",
|
||||
"*twerks*",
|
||||
"*sweats*",
|
||||
}
|
||||
var logoIndex = 0
|
||||
var isInProgressLine = false
|
||||
var logoLines []string
|
||||
|
@ -47,6 +27,34 @@ var pngWidth = 12
|
|||
var pngHeight = 12
|
||||
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() {
|
||||
dist := data.GetDistroVariable("ID")
|
||||
logo := Getascii(dist)
|
||||
|
@ -55,7 +63,7 @@ func CutePrintInit() {
|
|||
}
|
||||
if usepng {
|
||||
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")
|
||||
logoWidth = 0
|
||||
|
@ -111,7 +119,7 @@ type Format struct {
|
|||
func parseFormat(format string) (parsedFormat Format) {
|
||||
for _, v := range strings.Split(format, "|") {
|
||||
colorFormat, isColor := colors[v]
|
||||
if isColor {
|
||||
if isColor && hascolor {
|
||||
parsedFormat.colorFormat += colorFormat
|
||||
} else {
|
||||
switch v {
|
||||
|
@ -123,7 +131,9 @@ func parseFormat(format string) (parsedFormat Format) {
|
|||
parsedFormat.noUwuOverride = true
|
||||
case "*":
|
||||
default:
|
||||
//println("Unknown format code: ", v)
|
||||
if hascolor {
|
||||
println("Unknown format code: ", v)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -145,9 +155,6 @@ func CutePrint(
|
|||
|
||||
func CuteNewLine() {
|
||||
printLogoIfAtBeginningOfNewLine()
|
||||
if rand.Intn(5) == 0 && shoulduwuify {
|
||||
fmt.Printf(" %s", uwuEmotes[rand.Intn(len(uwuEmotes))])
|
||||
}
|
||||
isInProgressLine = false
|
||||
fmt.Println()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue