@@ -10,7 +10,9 @@ import (
1010 "encoding/json"
1111 "io/ioutil"
1212
13-
13+ ps "github.com/shirou/gopsutil/process"
14+ hst "github.com/shirou/gopsutil/host"
15+ // cp "github.com/shirou/gopsutil/cpu"
1416 "github.com/jaypipes/ghw"
1517 "golang.org/x/sys/windows/registry"
1618 "github.com/gilliek/go-xterm256/xterm256"
@@ -160,6 +162,15 @@ llllllllllll lllllllllllllllll
160162
161163 s = append (s , xterm256 .Sprint (userc , strings .ReplaceAll (user .Username , "\\ " , "@" )))
162164 s = append (s , xterm256 .Sprint (sep , "--------------------------------" ))
165+
166+ if (config .ShowUptime ){
167+ uptime , err := hst .Uptime ()
168+ if (err != nil ) {
169+ log .Fatal ("Failed to Get Uptime!" )
170+ }
171+ uptimes := secondsToHuman (int (uptime ))
172+ s = append (s , xterm256 .Sprint (title , config .Titles .Uptime + ": " ) + xterm256 .Sprint (info , uptimes ))
173+ }
163174
164175 memorySplit := strings .Split (memory .String (), "(" )
165176 mem := strings .Split (memorySplit [1 ], "," )
@@ -168,18 +179,33 @@ llllllllllll lllllllllllllllll
168179 if (config .ShowMem ) {
169180 s = append (s , xterm256 .Sprint (title , config .Titles .Memory + ": " ) + xterm256 .Sprint (info , strings .ReplaceAll (usableMem [0 ], "MB " , "GB" ) + "/" + strings .ReplaceAll (physMem [0 ], "MB" , "GB" )))
170181 }
171- if (config .ShowTotalCPUCores || config .ShowTotalCPUThreads ){
182+ if (config .ShowTotalCPUCores || config .ShowTotalCPUThreads || config . ShowCPU ){
172183 cpu , err := ghw .CPU ()
173184 if err != nil {
174185 fmt .Printf ("Error getting CPU info: %v" , err )
175186 }
187+ if (config .ShowCPU ){
188+ in := 0
189+ for x := range cpu .Processors {
190+ s = append (s , xterm256 .Sprint (title , "CPU #" + fmt .Sprint (in ) + ": " ) + xterm256 .Sprint (info , cpu .Processors [x ].Model ))
191+ }
192+ }
176193 if (config .ShowTotalCPUCores ){
177194 s = append (s , xterm256 .Sprint (title , config .Titles .CPUCores + ": " ) + xterm256 .Sprint (info , fmt .Sprint (cpu .TotalCores )))
178195 }
179196 if (config .ShowTotalCPUThreads ){
180197 s = append (s , xterm256 .Sprint (title , config .Titles .CPUThreads + ": " ) + xterm256 .Sprint (info , fmt .Sprint (cpu .TotalThreads )))
181198 }
182199 }
200+ if (config .ShowProcessCount ){
201+ pids , err := ps .Pids ()
202+
203+ if err != nil {
204+ log .Fatal ("Couldn't get Processes!" )
205+ }
206+
207+ s = append (s , xterm256 .Sprint (title , "Proccesses Running: " ) + xterm256 .Sprint (info , int64 (len (pids ))))
208+ }
183209 if (config .ShowWindowsVersion ){
184210 k , err := registry .OpenKey (registry .LOCAL_MACHINE , `SOFTWARE\Microsoft\Windows NT\CurrentVersion` , registry .QUERY_VALUE )
185211
@@ -203,12 +229,9 @@ llllllllllll lllllllllllllllll
203229 }
204230 gpuin := 0
205231 for _ , c := range gpu .GraphicsCards {
206- s = append (s , xterm256 .Sprint (title , config .Titles .GPUs + ": " + fmt .Sprint (gpuin ) + ": " ) + xterm256 .Sprint (info , c .DeviceInfo .Product .Name ))
232+ s = append (s , xterm256 .Sprint (title , config .Titles .GPUs + fmt .Sprint (gpuin ) + ": " ) + xterm256 .Sprint (info , c .DeviceInfo .Product .Name ))
207233 gpuin ++
208234 }
209- }
210- if (config .ShowWindowsVersion ){
211-
212235 }
213236 if (config .ShowBios ){
214237 bios , err := ghw .BIOS ()
0 commit comments