Skip to content

Commit

Permalink
NOT. EVEN. MORTAL
Browse files Browse the repository at this point in the history
  • Loading branch information
exhq committed Mar 11, 2024
1 parent 8e88cda commit 601eef4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
15 changes: 8 additions & 7 deletions data/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 601eef4

Please sign in to comment.