aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdotfiles/.local/bin/camtoggle11
1 files changed, 7 insertions, 4 deletions
diff --git a/dotfiles/.local/bin/camtoggle b/dotfiles/.local/bin/camtoggle
index a12fcb8..08c61cd 100755
--- a/dotfiles/.local/bin/camtoggle
+++ b/dotfiles/.local/bin/camtoggle
@@ -1,12 +1,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
+# If the hostname matches that of my laptop, use the second camera
camera="/dev/video0"
-[ -e /dev/video2 ] && camera="/dev/video2"
-[ -n "$1" ] && camera="$1"
+if [ -n "$1" ]; then
+ camera="$1"
+elif [ $HOSTNAME = "thinkslav" ]; then
+ camera="/dev/video2"
+fi
-pkill -f /dev/video || mpv \
+pkill -f "$camera" || mpv \
--gpu-context=wayland \
--profile=low-latency \
--no-osc \