Internal KVM Switch
FastAPI dashboard and polling service for Alienware-only KVM switching.
Trigger Logic
The app targets Alienware AW3423DWF for switching and uses Samsung as trigger-only.
Monitor filtering:
- Alienware target monitor: description contains
AW3423DWF - Samsung trigger monitor: Samsung-only descriptions (
SAM.../SAMSUNG) - Other non-Alienware DDC monitors are ignored for trigger selection
Configure only one value per machine:
- this device Alienware target port:
DP1,DP2, orHDMI - optional auxiliary trigger monitor: selected in UI; if not set, auto-detection is used
Samsung trigger input codes (for diagnostics only):
-
DP1->15 -
DP2->19(or16on some setups) -
HDMI->17 -
If the auxiliary external monitor is present, the app checks Alienware current input and enforces the configured
device_portviamonitorcontrol.
Retry behavior:
- Only attempts switching while the Samsung screen is connected
- After each switch attempt, waits
5seconds and rechecks - Tries at most
3times per Samsung-connected session - After success, it will not try again until the Samsung screen disconnects and reconnects
Run
uv run kvm-switch
The dashboard is served at http://localhost:4000.
Test
uv run pytest -q
Diagnostic Script
Use this to inspect connected DDC/CI monitors and current input values:
uv run monitorcontrol_main.py
Autostart
Recommended: one-command installer
From the project folder, run:
powershell -ExecutionPolicy Bypass -File .\install_autostart.ps1
This creates or updates a Startup shortcut for the current Windows user and points it to this folder's start_kvm_switch_background.vbs.
No hardcoded C:\Users\... path is required, so it works across tower/laptop deployments.
Manual option: Startup folder
- Press
Win + R - Run
shell:startup - Create a shortcut to this repo's
start_kvm_switch_background.vbs
The launcher resolves its own folder dynamically, so the project can live in different user directories.
Cleaner option: Task Scheduler
Use Task Scheduler if you want it to start automatically at logon with better control.
Program/script:
wscript.exe
Arguments:
"<full-path-to-project>\\start_kvm_switch_background.vbs"
Set the trigger to At log on. Optional: enable Hidden in task settings.