Last active
July 5, 2025 15:00
-
-
Save bschulz87/32e4673a5e6ae804a53da57a29485b85 to your computer and use it in GitHub Desktop.
Control OBS from Rodecaster Pro II MIDI pads using alsa and xdotool
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| obsScene () { | |
| xdotool key ctrl+shift+alt+$1 | |
| } | |
| obsScript () { | |
| xdotool key ctrl+shift+$1 | |
| } | |
| obsMisc () { | |
| xdotool key ctrl+alt+$1 | |
| } | |
| typeset -A streamingHotkey | |
| streamingHotkey[0]="a" | |
| streamingHotkey[1]="b" | |
| streamingHotkey[2]="c" | |
| streamingHotkey[3]="d" | |
| typeset -A recordingHotkey | |
| recordingHotkey[0]="ü" | |
| recordingHotkey[1]="ö" | |
| recordingHotkey[2]="ä" | |
| recordingHotkey[3]="ß" | |
| aseqdump -p "RODECaster Pro II" | \ | |
| while IFS=" ," read src ev1 ev2 channel label1 controller label2 value rest; do | |
| OBS_WINDOW=$(xdotool search --name "Profile: Twitch*") | |
| #echo "obs window: $OBS_WINDOW controller: $controller value $value channel: $channel" | |
| xdotool windowactivate $OBS_WINDOW; | |
| case "$controller" in | |
| 1) case "$channel" in | |
| 0) obsMisc ${streamingHotkey[$value]} ;; | |
| 1) obsMisc ${recordingHotkey[$value]} ;; | |
| esac ;; | |
| 2) obsScene $value; obsScript 1; # reset ready timer | |
| if (($value == 2)); then # get ready scene | |
| obsScript 2; # start | |
| fi ;; | |
| 3) obsScript $value ;; | |
| esac | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment