2.7 KiB
obsdc
OBS control from D-Bus messages
Send a D-Bus signal to perform an operation with src/obsdc-signal, which takes a single operation command
as an argument, and performs an action in OBS.
Operations
SCENE_NEXT- switch to the next sceneSCENE_PREV- switch to the previous sceneSCENE_#- switch to the indicated scene- replace
#with scene index, starting with 1.
- replace
STUDIO_TRANSITION- transition the studio preview and programSTUDIO_MODE_TOGGLE- toggle studio modePAN_UP- move the top unlocked source up 50pxPAN_DOWN- move the top unlocked source down 50pxPAN_LEFT- move the top unlocked source left 50pxPAN_RIGHT- move the top unlocked source right 50pxt
Configuration
Configuration is read from $XDG_CONFIG_HOME/net.eksb.obsdc/config.properties
Configuration options
host- OBS websocket host (default:localhost)port- OBS websocket port (default:4455)password- OBS websocket password (required)
systemd
A systemd unit file (obsdc.service) is included.
- Copy the file to
~/.config/systemd/user/. - Edit the
ExecStartline for where you have installed obsdc. systemctl --user enable obsdcsystemctl --user start obsdc
Build
gradle build
Run
tar xf build/distributions/obsdc.tarcd obsdc- Create config file. See [#Configuration].
bin/obsdcbin/obsdc-signalto send an op.
Code
Start at Main.
Obs is a wrapper around obs-websocket-java that handles reconnects and queuing operations until the websocket it ready.
OpRunner has the logic to run Ops
using an Obs.
DBus listens for the D-Bus signals and calls OpRunner.
History/Rationale
I usually code on a 4k monitor in portrait mode. To show what I am doing on video calls, I use OBS to share that monitor, but it is a 2160x4096 source in a 1920x1080 scene.
I have
a macropad
with three knobs.
My window manager is configured to call obsdc-signal with
PAN_UP/PAN_DOWN for the keys emitted by the left knob,
PAN_RIGHT/PAN_LEFT for the keys emitted by the right knob, and
SCENE_NEXT/SCENE_PREV for the keys emitted by the center knob.
The regular keys on the macropad are mapped to the other actions.
So now I can quickly control what people can see without having to focus (or even make visible) the OBS window.