NOT. EVEN. MORTAL
This commit is contained in:
parent
8e88cda8e1
commit
601eef4590
2 changed files with 10 additions and 9 deletions
15
data/data.go
15
data/data.go
|
@ -143,13 +143,14 @@ func FormatTime(seconds int) string {
|
||||||
hourRemaining := strconv.Itoa(hour % 24)
|
hourRemaining := strconv.Itoa(hour % 24)
|
||||||
return day + "d " + hourRemaining + "h " + minutesRemaining + "m " + secondsRemaining + "s"
|
return day + "d " + hourRemaining + "h " + minutesRemaining + "m " + secondsRemaining + "s"
|
||||||
}
|
}
|
||||||
func GetCPU() {
|
|
||||||
mem, _ := os.Open("/proc/cpuinfo")
|
// func GetCPU() {
|
||||||
memInfo := make([]byte, 1024)
|
// mem, _ := os.Open("/proc/cpuinfo")
|
||||||
mem.Read(memInfo)
|
// memInfo := make([]byte, 1024)
|
||||||
mem.Close()
|
// mem.Read(memInfo)
|
||||||
print(memInfo)
|
// mem.Close()
|
||||||
}
|
// return (memInfo)
|
||||||
|
// }
|
||||||
func GetTerminal() string {
|
func GetTerminal() string {
|
||||||
a, existprgm := os.LookupEnv("TERM_PROGRAM")
|
a, existprgm := os.LookupEnv("TERM_PROGRAM")
|
||||||
if !existprgm {
|
if !existprgm {
|
||||||
|
|
4
main.go
4
main.go
|
@ -77,8 +77,8 @@ func handlePrint(action, format string, rest string) {
|
||||||
return data.FormatTime(no)
|
return data.FormatTime(no)
|
||||||
},
|
},
|
||||||
"hostname": func() string { return data.Unamebs("-n") },
|
"hostname": func() string { return data.Unamebs("-n") },
|
||||||
"kernelname": func() string { return data.Unamebs("-s") },
|
"kernelname": func() string { return data.Unamebs("-srm") },
|
||||||
"CPU": data.GetGPU,
|
//"CPU": data.GetCPU,
|
||||||
"GPU": data.GetGPU,
|
"GPU": data.GetGPU,
|
||||||
"shell": func() string { return getShellVersion(data.GetShell()) },
|
"shell": func() string { return getShellVersion(data.GetShell()) },
|
||||||
"terminal": data.GetTerminal,
|
"terminal": data.GetTerminal,
|
||||||
|
|
Loading…
Reference in a new issue