grigio / obs-cmd

obs-cmd is a OBS cli for obs-websocket v5 the current obs-studio implementation. It is useful on Wayland Linux or to control OBS via terminal
MIT License
125 stars 20 forks source link

Ability to query for current scene #62

Open luthes opened 3 weeks ago

luthes commented 3 weeks ago

I hacked this in myself with a new command obs-cmd current which implements the current_program_scene method, I can PR it if you'd merge it, but I think it'd be better suited under the scene sub-command, or even better as an argument where appropriate.

        Commands::Current => {
            let res = client.scenes().current_program_scene().await;
            println!("Result: {:?}", res);
        }

This is useful for using groups across multiple OBS scenes. ie, I have Mic/Camera in a group that I reuse across scenes, so then I can just do a obs-cmd scene-item toggle "$(obs-cmd current)" "group-mic-webcam" rather than having to have a specific command for each scene. I also hav eto do some ugly formatting with Sed in case you're wondering about the output, not too familiar with Rust.

grigio commented 3 weeks ago

If you make a PR I could merge it

SumDonkuS commented 2 weeks ago

I was looking for something similar and saw this issue open.