(Windows) Enhanced keyboard volume control that redirects media key volume adjustments to the focused application instead of system volume.
- Install Rust (latest stable version)
- Windows 10 or later
- Visual Studio Build Tools (will be automatically prompted during cargo build if missing)
-
Clone the repository:
git clone https://github.com/easymac/focused-window-volume.git cd focused-window-volume -
Build the project:
cargo build --release -
Run the application:
cargo run --release
The application will be built in the target/release directory. You can:
- Copy the executable (
focused-window-volume.exe) to a permanent location - Create a shortcut to the application in your Windows startup folder to have it run on system boot:
- Press
Win+R, typeshell:startupand press Enter - Create a shortcut to the executable in this folder
- Press
- Volume keys should automatically be captured once the application is running
- To exit the application, right-click the system tray icon and select "Exit"
For applications that use multi-process achitecture (e.g. Google Chrome), the process (and PID) which is associated with a window will often be different from the process (and PID) which is associated with a session.
As a heuristic, the path of the executable is used to identify application groups instead of process IDs in order to match the focused window with the audio session.
For now, we're going to evaluate the practical reliability of this heuristic and then consider other approaches if there are problems.
All suggested solutions are very welcome & appreciated to be filed as issues.
Thank you for thinking about helping out with the project!
All bug reports, suggestions, feedback, and ideas are welcome & appreciated as Issues. Pull requests are very welcome!
Code review PRs are especially welcome 🔥