dotfiles/scripts/screen-share-toggle

12 lines
301 B
Plaintext
Raw Permalink Normal View History

2022-02-06 19:45:28 +01:00
#!/bin/bash
USER=$(logname)
if [ -f "/tmp/$USER.screen-share" ]; then
screen -S "Screen Share" -X quit
rm "/tmp/$USER.screen-share"
else
screen -dmS "Screen Share" ffmpeg -f x11grab -video_size 1920x1080 -i :0+0,1050 -pix_fmt yuv420p -r 30 -f v4l2 /dev/video9
touch "/tmp/$USER.screen-share"
fi