NOT. EVEN. MORTAL

This commit is contained in:
exhq 2024-03-11 10:57:32 +03:30
parent 8e88cda8e1
commit 601eef4590
2 changed files with 10 additions and 9 deletions

View file

@ -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 {

View file

@ -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,