From e87df82bc71e38e77a3bd768d802ecd57a0e9ffb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yaroslav=20de=20la=20Pe=C3=B1a=20Smirnov?= Date: Mon, 14 Dec 2020 00:32:06 +0300 Subject: camtoggle: small changes on how to detect the right camera --- dotfiles/.local/bin/camtoggle | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'dotfiles/.local') 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 \ -- cgit v1.2.3