changed fetch info output style

This commit is contained in:
b1u3rchie 2026-04-06 11:45:19 +02:00 committed by nekohepott
parent 71ab162576
commit 695625f4fc
No known key found for this signature in database

12
main.go
View File

@ -45,8 +45,8 @@ func appendMissingConfigKeys(pathConf string, md toml.MetaData) error {
missing = append(missing, `# Stats layout: reorder or remove items to customize your fetch missing = append(missing, `# Stats layout: reorder or remove items to customize your fetch
# Available: "dist", "host", "cpu", "kernel", "ram", "gpu", "de/wm", "pkgs", "shell", "terminal", "uptime" # Available: "dist", "host", "cpu", "kernel", "ram", "gpu", "de/wm", "pkgs", "shell", "terminal", "uptime"
layout = [ layout = [
"dist",
"host", "host",
"dist",
"cpu", "cpu",
"kernel", "kernel",
"ram", "ram",
@ -115,8 +115,8 @@ ascii = false
# Stats layout: reorder or remove items to customize your fetch # Stats layout: reorder or remove items to customize your fetch
# Available: "dist", "host", "cpu", "kernel", "ram", "gpu", "de/wm", "pkgs", "shell", "terminal", "uptime" # Available: "dist", "host", "cpu", "kernel", "ram", "gpu", "de/wm", "pkgs", "shell", "terminal", "uptime"
layout = [ layout = [
"dist",
"host", "host",
"dist",
"cpu", "cpu",
"kernel", "kernel",
"ram", "ram",
@ -539,7 +539,7 @@ func main() {
conf, _ := initConfig() conf, _ := initConfig()
if len(conf.Layout) == 0 { if len(conf.Layout) == 0 {
conf.Layout = []string{"dist", "host", "cpu", "ram", "shell", "uptime"} conf.Layout = []string{"host","dist", "cpu", "ram", "shell", "uptime"}
fmt.Println("Warning: No layout specified in config, using default") fmt.Println("Warning: No layout specified in config, using default")
} }
@ -568,10 +568,10 @@ func main() {
for _, item := range conf.Layout { for _, item := range conf.Layout {
switch strings.ToLower(item) { switch strings.ToLower(item) {
case "dist":
stats = append(stats, Info{"dist", dist})
case "host": case "host":
stats = append(stats, Info{"host", getHostname()}) stats = append(stats, Info{"host", getHostname()})
case "dist":
stats = append(stats, Info{"OS", dist})
case "cpu": case "cpu":
stats = append(stats, Info{"cpu", getCpu()}) stats = append(stats, Info{"cpu", getCpu()})
case "kernel", "krnl": case "kernel", "krnl":
@ -595,7 +595,7 @@ func main() {
var statsLines []string var statsLines []string
for _, info := range stats { for _, info := range stats {
statsLines = append(statsLines, fmt.Sprintf("~ %s%s%s: %s", Blue, info.Label, Reset, info.Value)) statsLines = append(statsLines, fmt.Sprintf("-> %s%s%s: %s", Blue, info.Label, Reset, info.Value))
} }
var logoLines []string var logoLines []string