changed fetch info output style
This commit is contained in:
parent
71ab162576
commit
695625f4fc
14
main.go
14
main.go
@ -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
|
||||
# Available: "dist", "host", "cpu", "kernel", "ram", "gpu", "de/wm", "pkgs", "shell", "terminal", "uptime"
|
||||
layout = [
|
||||
"host",
|
||||
"dist",
|
||||
"host",
|
||||
"cpu",
|
||||
"kernel",
|
||||
"ram",
|
||||
@ -115,8 +115,8 @@ ascii = false
|
||||
# Stats layout: reorder or remove items to customize your fetch
|
||||
# Available: "dist", "host", "cpu", "kernel", "ram", "gpu", "de/wm", "pkgs", "shell", "terminal", "uptime"
|
||||
layout = [
|
||||
"host",
|
||||
"dist",
|
||||
"host",
|
||||
"cpu",
|
||||
"kernel",
|
||||
"ram",
|
||||
@ -539,7 +539,7 @@ func main() {
|
||||
conf, _ := initConfig()
|
||||
|
||||
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")
|
||||
}
|
||||
|
||||
@ -568,10 +568,10 @@ func main() {
|
||||
|
||||
for _, item := range conf.Layout {
|
||||
switch strings.ToLower(item) {
|
||||
case "dist":
|
||||
stats = append(stats, Info{"dist", dist})
|
||||
case "host":
|
||||
stats = append(stats, Info{"host", getHostname()})
|
||||
stats = append(stats, Info{"host", getHostname()})
|
||||
case "dist":
|
||||
stats = append(stats, Info{"OS", dist})
|
||||
case "cpu":
|
||||
stats = append(stats, Info{"cpu", getCpu()})
|
||||
case "kernel", "krnl":
|
||||
@ -595,7 +595,7 @@ func main() {
|
||||
|
||||
var statsLines []string
|
||||
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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user