dotfiles/scripts/webcam-toggle

12 lines
311 B
Plaintext
Raw Permalink Normal View History

2022-02-06 19:45:28 +01:00
#!/bin/bash
USER=$(logname)
if [ -f "/tmp/$USER.webcam" ]; then
screen -S "Webcam" -X quit
rm "/tmp/$USER.webcam"
else
screen -dmS "Webcam" ffmpeg -video_size 1920x1080 -framerate 30 -c:v mjpeg -i /dev/video0 -c:v mjpeg -vf lenscorrection=k1=-0.1:k2=-0.05 -f v4l2 /dev/video8
touch "/tmp/$USER.webcam"
fi