diff --git a/i3/.config/i3/scripts/webcam-toggle.sh b/i3/.config/i3/scripts/webcam-toggle.sh index 14f8b31..8487a62 100755 --- a/i3/.config/i3/scripts/webcam-toggle.sh +++ b/i3/.config/i3/scripts/webcam-toggle.sh @@ -1,12 +1,19 @@ #!/bin/sh -pkill -f /dev/video || \ +CAMERA=${CAMERA:-/dev/video0} + +pkill -f "$CAMERA" || \ mpv --title="mpv-floating-window" \ --no-config \ --no-osc \ --no-input-default-bindings \ --input-conf=/dev/null \ - -vo=gpu \ + --vo=gpu \ --geometry=-0-0 \ --autofit=30% \ - av://v4l2:/dev/video0 + --profile=low-latency \ + --untimed \ + --demuxer-lavf-format=video4linux2 \ + --demuxer-lavf-o-set=input_format=mjpeg \ + --demuxer-lavf-o=video_size=320x240\ + "$CAMERA"