diff --git a/bug.n-dev.exe b/bug.n-dev.exe index b65901e..59d244d 100644 Binary files a/bug.n-dev.exe and b/bug.n-dev.exe differ diff --git a/doc/CHANGES.md b/doc/CHANGES.md index d4512e3..2b89131 100644 --- a/doc/CHANGES.md +++ b/doc/CHANGES.md @@ -14,6 +14,7 @@ periodically so that it may be recovered after a restart. 3. `+` Manual tiling. 4. `+` Increasing MFactor Resizing Over Time 5. `+` Bar transparency +6. `+` Reading in the sound volume and mute status and displaying it in the status bar. | # | Configuration variables | Hotkeys | | ---:| --------------------------------- | ----------------------------------------------- | @@ -27,6 +28,7 @@ periodically so that it may be recovered after a restart. | | | `!+y::View_traceAreas()` | | 4. | `Config_mFactCallInterval=700` | `View_setMFactor(d, dFact=1)` | | 5. | `Config_barTransparency=off` | | +| 6. | `Config_readinVolume` | | ### 8.3.0 diff --git a/doc/Default_configuration.md b/doc/Default_configuration.md index 8e630fc..e102703 100644 --- a/doc/Default_configuration.md +++ b/doc/Default_configuration.md @@ -110,6 +110,10 @@ and displayed in the status bar. > If true (`=1`), the current time is read in (format: "HH:MM") and displayed in the status bar. +`Config_readinVolume=0` +> If true (`=1`), the current sound volume is read in +(format: "VOL: ") and displayed in the status bar. + `Config_readinInterval=30000` > Time in milliseconds after which the above status values are refreshed. diff --git a/src/Config.ahk b/src/Config.ahk index 91a76a0..a18d11c 100644 --- a/src/Config.ahk +++ b/src/Config.ahk @@ -45,6 +45,7 @@ Config_init() Config_readinMemoryUsage := False Config_readinNetworkLoad := False Config_readinTime := True + Config_readinVolume := False Config_readinInterval := 30000 ;; Windows ui elements diff --git a/src/ResourceMonitor.ahk b/src/ResourceMonitor.ahk index db776c0..be6a725 100644 --- a/src/ResourceMonitor.ahk +++ b/src/ResourceMonitor.ahk @@ -37,32 +37,40 @@ ResourceMonitor_cleanup() { ResourceMonitor_getText() { - Global Config_readinCpu, Config_readinDate, Config_readinDiskLoad, Config_readinMemoryUsage, Config_readinNetworkLoad + Global Config_readinCpu, Config_readinDate, Config_readinDiskLoad, Config_readinMemoryUsage, Config_readinNetworkLoad, Config_readinVolume text := "" + If Config_readinVolume + { + text .= " VOL: " ResourceMonitor_getSoundVolume() "% " + } If Config_readinCpu + { + If Config_readinVolume + text .= "|" text .= " CPU: " ResourceMonitor_getSystemTimes() "% " + } If Config_readinMemoryUsage { - If Config_readinCpu + If (Config_readinVolume Or Config_readinCpu) text .= "|" text .= " RAM: " ResourceMonitor_getMemoryUsage() "% " } If Config_readinDiskLoad { - If (Config_readinCpu Or Config_readinMemoryUsage) + If (Config_readinVolume Or Config_readinCpu Or Config_readinMemoryUsage) text .= "|" ResourceMonitor_getDiskLoad(rLoad, wLoad) text .= " Dr: " rLoad "% | Dw: " wLoad "% " } If Config_readinNetworkLoad { - If (Config_readinCpu Or Config_readinMemoryUsage Or Config_readinDiskLoad) + If (Config_readinVolume Or Config_readinCpu Or Config_readinMemoryUsage Or Config_readinDiskLoad) text .= "|" ResourceMonitor_getNetworkLoad(upLoad, dnLoad) text .= " UP: " upLoad " KB/s | dn: " dnLoad " KB/s " } - If Config_readinDate And (Config_readinCpu Or Config_readinMemoryUsage Or Config_readinDiskLoad Or Config_readinNetworkLoad) + If Config_readinDate And (Config_readinVolume Or Config_readinCpu Or Config_readinMemoryUsage Or Config_readinDiskLoad Or Config_readinNetworkLoad) text .= "|" Return, text @@ -114,6 +122,18 @@ ResourceMonitor_getNetworkLoad(ByRef upLoad, ByRef dnLoad) } ;; Pillus: System monitor (HDD/Wired/Wireless) using keyboard LEDs (http://www.autohotkey.com/board/topic/65308-system-monitor-hddwiredwireless-using-keyboard-leds/) +ResourceMonitor_getSoundVolume() { + SoundGet, volume, MASTER, VOLUME + SoundGet, mute, MASTER, MUTE + text := "" + If mute = On + text .= "m" + Else + text .= " " + text .= SubStr(" " Round(volume), -2) + Return, text +} + ResourceMonitor_getSystemTimes() { ;; Total CPU Load Static oldIdleTime, oldKrnlTime, oldUserTime