aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.local/bin/camtoggle
blob: 8f3de0e28cc5247c22b3f48c6a1bea6a984765b3 (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"
[ -f /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"