Jafner.net/dotfiles/utility-scripts/obs-studio/recording-toggle.py

22 lines
603 B
Python
Raw Normal View History

2024-06-04 03:04:47 -07:00
#!/usr/bin/env python3
# Author: Andrew Shark
# Homepage: https://gitlab.com/AndrewShark/obs-scripts
# License: GPLv3
# This script allows you to use a single shortcut for start recording, and then toggle pause recording,
# (just like in ssr), because there is no such hotkey in OBS.
# Also you can use this in Wayland session, as a workaround, because currently, there is no global hotkeys protocol.
import obsws_python as obs
cl = obs.ReqClient()
r = cl.get_record_status()
active = r.output_active
paused = r.output_paused
if not active:
cl.start_record()
else:
cl.toggle_record_pause()