aboutsummaryrefslogtreecommitdiff
path: root/scripts/p7s/google_meet.py
blob: a26dfeef1ffe012c288b4d712ecd44bc19848f65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import subprocess

from p7s import multiline_string as _
from p7s import systemd

"""
Needs:

* https://github.com/ChrisRegado/streamdeck-googlemeet/releases/latest
* https://github.com/vi/wsbroad
* https://github.com/vi/websocat/
"""


def install_stream_deck_google_meet_wsbroad_server():
    systemd.create_user_unit("stream-deck-google-meet-wsbroad.service", _("""
    [Unit]
    Description=Server for streamdeck-googlemeet browser extension based on wsbroad

    [Service]
    ExecStart=/home/alex/.local/bin/wsbroad 127.0.0.1:2394

    [Install]
    WantedBy=default.target
    """))

    systemd.reload()
    systemd.enable_now("stream-deck-google-meet-wsbroad.service")


def toggle_mute():
    subprocess.run([
        "websocat",
        "--text",
        "--oneshot",
        'literal:{"event":"toggleMic"}',
        "ws://127.0.0.1:2394"
    ], check=True)