Code Monkey home page Code Monkey logo

elgatokey-cam-bind's Introduction

Elgato Key Camera Bind

This is an experimental script to make Elgato's Key Light Air turn on and off according to your webcam's current state.

The main idea here is to automate the task of turning it on/off for people that always use it on video calls.

The script tries to detect camera activity from system logs and change the Key Light status accordingly, by making HTTP requests to the device.

How to run it

You can try the script by cloning this repository and then running:

./camera-bind/camera-bind.sh

With the script running, try to make some application use your webcam (i.e. https://meet.google.com). It should turn Elgato Key Light on and off whenever you enable/disable your webcam.

Only Linux and MacOS (Monterey) are supported.

How to make it run automatically

Linux

In order to make the script run automatically on startup in Linux, you can create a systemctl daemon. To do so, create the file /etc/systemd/system/elgato-cam-bind.service with the following content:

[Unit]
Description=Elgato Key Camera Bind

[Service]
Type=simple
User=root
ExecStart=PATH_WHERE_YOU_CLONED_THIS_REPO/elgatokey-cam-bind/camera-bind/camera-bind.sh
Restart=on-failure

[Install]
WantedBy=default.target

Then enable and start the service:

sudo systemctl daemon-reload
sudo systemctl enable --now elgato-cam-bind.service

MacOS

In Mac, you can make the script run as a launch agent. In order to do that, you have to create the file ~/Library/LaunchAgents/com.my.elgato-cam-bind.plist with the following content:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
	<dict>
		<key>Label</key>
		<string>com.my.elgato-cam-bind</string>
		<key>Program</key>
		<string>PATH_WHERE_YOU_CLONED_THIS_REPO/elgatokey-cam-bind/camera-bind/camera-bind.sh</string>
		<key>RunAtLoad</key>
		<true/>
		<key>KeepAlive</key>
		<true/>
	</dict>
</plist>

And then run the following command:

launchctl load ~/Library/LaunchAgents/com.my.elgato-cam-bind.plist

elgatokey-cam-bind's People

Contributors

netoabel avatar dependabot[bot] avatar

Stargazers

フランソワ avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.