diff --git a/docs/docs/segment-sysinfo.md b/docs/docs/segment-sysinfo.md index 53fe6c0f..a5e3b6d2 100644 --- a/docs/docs/segment-sysinfo.md +++ b/docs/docs/segment-sysinfo.md @@ -13,10 +13,9 @@ Display SysInfo. ```json { "type":"sysinfo", - "powerline_symbol": "", + "powerline_symbol": "\ue0b0", "foreground": "#ffffff", "background": "#8f43f3", - "invert_powerline": true, "properties": { "precision": 2, "template":" \uf85a {{ round .PhysicalPercentUsed .Precision }}% " @@ -51,6 +50,8 @@ Display SysInfo. - `.Load5`: `float64` - is the current load5 (can be empty on windows) - `.Load15`: `float64` - is the current load15 (can be empty on windows) - `.CPU`: `[]struct` - an array of [InfoStat][cpuinfo] object, you can use any property it has e.g. `(index .CPU 0).Cores` +- `.Disks`: `[]struct` - an array of [IOCountersStat][ioinfo] object, you can use any property it has e.g. `.Disks.disk0.IoTime` [cpuinfo]: https://github.com/shirou/gopsutil/blob/78065a7ce2021f6a78c8d6f586a2683ba501dcec/cpu/cpu.go#L32 +[ioinfo]: https://github.com/shirou/gopsutil/blob/e0ec1b9cda4470db704a862282a396986d7e930c/disk/disk.go#L32 [templates]: /docs/config-templates diff --git a/src/segments/sysinfo.go b/src/segments/sysinfo.go index 7bae3319..ee220acc 100644 --- a/src/segments/sysinfo.go +++ b/src/segments/sysinfo.go @@ -5,6 +5,7 @@ import ( "oh-my-posh/properties" cpu "github.com/shirou/gopsutil/v3/cpu" + disk "github.com/shirou/gopsutil/v3/disk" load "github.com/shirou/gopsutil/v3/load" mem "github.com/shirou/gopsutil/v3/mem" ) @@ -28,6 +29,8 @@ type SystemInfo struct { Load1 float64 Load5 float64 Load15 float64 + // disk + Disks map[string]disk.IOCountersStat } const ( @@ -80,4 +83,9 @@ func (s *SystemInfo) Init(props properties.Properties, env environment.Environme if err == nil { s.CPU = processors } + // disk + diskIO, err := disk.IOCounters() + if err == nil { + s.Disks = diskIO + } }