sbz-switch
sbz-switch copied to clipboard
Autohotkey Example
When I came across this repo, I wanted to make some keyboard macro to make use of the executable. Perhaps providing an example would be useful in the readme or wiki?
I currently have an autohotkey switcher example available:
#SingleInstance Ignore
+NumpadSub::
{
RunWait "sbz-switch.exe dump -o _dump.toml",,"Min"
Dump := FileRead("_dump.toml")
RegExMatch(Dump, "SelectOutput = (\d)", &SubPat)
Output := "0"
IF (SubPat[1] = "0") {
Output := "1"
}
ELSE {
Output := "0"
}
RunWait Format("sbz-switch.exe set -i `"Device Control`" SelectOutput {1}", Output),,"Min"
RunWait "taskkill /f /im `"NVIDIA Broadcast UI.exe`"",,"Min"
RunWait "taskkill /f /im `"NVIDIA Broadcast.exe`"",,"Min"
Run "C:\Program Files\NVIDIA Corporation\NVIDIA Broadcast\NVIDIA Broadcast UI.exe",,"Min"
}
This will switch audio and restart NVIDIA broadcast (which seems to die when I switch sometimes)