neowofetch/utils/args.go

44 lines
844 B
Go
Raw Normal View History

2022-09-22 12:48:20 +02:00
package utils
import (
"os"
2022-09-25 10:24:09 +02:00
"os/exec"
2022-09-22 12:48:20 +02:00
"strings"
)
var args []string
var shoulduwuify bool = true
var noascii bool = false
2022-09-22 14:44:27 +02:00
var usepng bool = false
var hascolor bool = true
2022-09-25 10:24:09 +02:00
var Customascii = false
var asciidir string
2022-09-22 12:48:20 +02:00
func Initargs() {
args = os.Args[1:]
for _, argument := range args {
2022-09-25 10:24:09 +02:00
if strings.HasPrefix(argument, "--ascii=") {
cmd := exec.Command("whoami")
shell, _ := cmd.Output()
funny := strings.Replace(string(shell), "\n", "", -1)
Customascii = true
asciidir = strings.ReplaceAll(argument[8:], "~", "/home/"+funny)
} else if strings.HasPrefix(argument, "--") {
2022-09-22 12:48:20 +02:00
switch argument {
case "--nouwu":
shoulduwuify = false
case "--noascii":
noascii = true
2022-09-22 14:44:27 +02:00
case "--usepng":
usepng = true
case "--nocolor":
hascolor = false
2022-09-22 12:48:20 +02:00
}
}
}
}
func Woulduwuify() bool {
return shoulduwuify
}