[2025-05-20 Tue] Announcement: cmack is the new maintainer. Yay! =) - Sacha
Totally bubblegum-and-string at the moment.
You’ll need Open Broadcaster Software and the obs-websocket plugin for it. Set it up in Tools > WebSockets Server Settings
. Set a password there.
You will also need websocket, which is available from GNU ELPA. You can install it with M-x package-install RET websocket RET
.
You will probably be able to use M-x obs-websocket-connect
to connect to your OBS server. I have no idea if it will work for anyone but me, though. Good luck!
You can use (setq obs-websocket-password "yourpasswordhere")
in your Emacs configuration file so that it won’t prompt you for the password.
Here’s my config. It uses use-package and hydra.
(use-package websocket) (defun my/twitch-message (text) (interactive "MText: ") (with-current-buffer (get-buffer-create "Twitch message") (erase-buffer) (insert text) (goto-char (point-min)))) (use-package obs-websocket :config (defhydra my/obs-websocket (:exit t) "Control Open Broadcast Studio" ("c" (obs-websocket-connect) "Connect") ("d" (obs-websocket-send "SetCurrentProgramScene" :scene-name "Desktop") "Desktop") ("e" (obs-websocket-send "SetCurrentProgramScene" :scene-name "Emacs") "Emacs") ("i" (obs-websocket-send "SetCurrentProgramScene" :scene-name "Intermission") "Intermission") ("v" (browse-url "https://twitch.tv/sachachua")) ("m" my/twitch-message "Message") ("t" my/twitch-message "Message") ("<f8>" my/twitch-message "Message") ;; Then I can just f8 f8 ("sb" (obs-websocket-send "StartStream") "Stream - begin") ("se" (obs-websocket-send "StopStream") "Stream - end")) (global-set-key (kbd "<f8>") #'my/obs-websocket/body) :load-path "~/code/obs-websocket-el" :ensure nil)
Here is another config option using use-package
and transient
features standard in Emacs 30:
(use-package websocket :ensure t) (use-package obs-websocket :ensure t :vc (:url "https://github.com/obs-websocket-el/obs-websocket-el.git" :rev :newest) :bind (("<f8>" . my/obs-websocket-tmenu)) :config (require 'transient) (transient-define-prefix my/obs-websocket-tmenu () "Transient menu for controlling OBS via websocket" ["Connection" ("c" "Connect to OBS" obs-websocket-connect)] ["Streaming" ("sb" "Stream - begin" (lambda () (interactive) (obs-websocket-send "StartStream"))) ("se" "Stream - end" (lambda () (interactive) (obs-websocket-send "StopStream")))] ["Scenes" ("d" "Desktop" (lambda () (interactive) (obs-websocket-send "SetCurrentProgramScene" :sceneName "Desktop"))) ("e" "Emacs" (lambda () (interactive) (obs-websocket-send "SetCurrentProgramScene" :sceneName "Emacs"))) ("i" "Intermission" (lambda () (interactive) (obs-websocket-send "SetCurrentProgramScene" :sceneName "Intermission"))) ("v" "Browse Channel" (lambda () (interactive) (browse-url "https://twitch.tv/<your-channel-here>"))) ]))
Better installation instructions will eventually be written by someone, if anyone wants to actually maintain this.
Protocol reference: 5.x.x Websocket Protocol Reference
Contributors:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4