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)
|
||||
return day + "d " + hourRemaining + "h " + minutesRemaining + "m " + secondsRemaining + "s"
|
||||
}
|
||||
func GetCPU() {
|
||||
mem, _ := os.Open("/proc/cpuinfo")
|
||||
memInfo := make([]byte, 1024)
|
||||
mem.Read(memInfo)
|
||||
mem.Close()
|
||||
print(memInfo)
|
||||
}
|
||||
|
||||
// func GetCPU() {
|
||||
// mem, _ := os.Open("/proc/cpuinfo")
|
||||
// memInfo := make([]byte, 1024)
|
||||
// mem.Read(memInfo)
|
||||
// mem.Close()
|
||||
// return (memInfo)
|
||||
// }
|
||||
func GetTerminal() string {
|
||||
a, existprgm := os.LookupEnv("TERM_PROGRAM")
|
||||
if !existprgm {
|
||||
|
|
4
main.go
4
main.go
|
@ -77,8 +77,8 @@ func handlePrint(action, format string, rest string) {
|
|||
return data.FormatTime(no)
|
||||
},
|
||||
"hostname": func() string { return data.Unamebs("-n") },
|
||||
"kernelname": func() string { return data.Unamebs("-s") },
|
||||
"CPU": data.GetGPU,
|
||||
"kernelname": func() string { return data.Unamebs("-srm") },
|
||||
//"CPU": data.GetCPU,
|
||||
"GPU": data.GetGPU,
|
||||
"shell": func() string { return getShellVersion(data.GetShell()) },
|
||||
"terminal": data.GetTerminal,
|
||||
|
|
Loading…
Reference in a new issue