Small Swift utility that listens to a Dell USB volume knob over HID and adjusts the system output volume on macOS.
- macOS 12 or newer (tested on Apple Silicon)
- Xcode Command Line Tools (for swiftc)
- Tested with the Dell SK-8135 keyboard knob; other HID consumer-control devices may require minor adjustments.
Clone or download this repository:
git clone https://github.com/saygonka/DellKnobVolume.git
cd DellKnobVolumeIf you downloaded a ZIP, unzip it and open the folder in Terminal before continuing.
Compile the tool with the required frameworks:
swiftc main.swift -framework IOKit -framework CoreAudio -o DellKnobVolumeThis produces the executable DellKnobVolume in the project directory.
Launch the binary directly:
./DellKnobVolumeYou should see:
Running. Rotate the knob to change the volume (5% step).
Keep the process running while you use the knob.
To inspect HID traffic, enable debug logging at build time:
swiftc main.swift -framework IOKit -framework CoreAudio -o DellKnobVolume -DDEBUG
./DellKnobVolumeWhen compiled with -DDEBUG, the program prints any unhandled HID usage pairs so you can extend the switch statement if your device exposes different controls.
- 
Build the binary and copy it to a persistent location, e.g.: mkdir -p ~/Applications/DellKnobVolume cp DellKnobVolume ~/Applications/DellKnobVolume/ 
- 
Create a LaunchAgent plist at ~/Library/LaunchAgents/com.example.dellknobvolume.plistwith the following contents (update the paths to match your setup):<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>com.example.dellknobvolume</string> <key>ProgramArguments</key> <array> <string>/Users/your-user/Applications/DellKnobVolume/DellKnobVolume</string> </array> <key>RunAtLoad</key> <true/> <key>KeepAlive</key> <true/> </dict> </plist> 
- 
Load the agent: launchctl load ~/Library/LaunchAgents/com.example.dellknobvolume.plist
The utility now starts automatically each time you log in. To unload it later, run:
launchctl unload ~/Library/LaunchAgents/com.example.dellknobvolume.plist