aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.local/bin/camtoggle
blob: 00fd20197ad1f8bfce32bd5f603d5b833262178e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh

# I have two cameras on my laptop and the first one is an IR camera (video0)
# If a second camera is present, use the second one
camera="/dev/video0"
[ -e /dev/video2 ] && camera="/dev/video2"

pkill -f /dev/video || mpv \
  --gpu-context=wayland \
  --no-osc \
  --no-input-default-bindings \
  --input-conf=/dev/null \
  --geometry=-0-0 \
  --autofit=25% \
  --title="mpvfloat" "$camera"