Skip to content

Schoonology/on-air

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

On-Air

A little script to let you handle when your camera (or microphone!) turns on and off.

Usage (with example script)

./camera_status | ./example

This command will not exit, as the camera_status script is designed to run as a daemon. To fully exercise this, open and close an application like Photo Booth that uses your camera.

Writing your own script

The camera_status script spits 1s and 0s out to STDOUT. If you write your own script (starting from the example script is a great way to get started), pipe camera_status to that script, and read those 1s and 0s from your own script. Each will be terminated by a line ending.

Launchd support

To add On-Air to launchd for your machine, run the generate script with the name (or relative path) of your custom script, then add the filled-in launchd.plist as normal. For example, to integrate the example script with launchd, run:

$ ./generate example
$ launchctl load launchd.plist

That's it! At that point, the example script should be plugging away, writing its example output to.../dev/null. (If you want to change that and see it in action, just change the Standard*Path options in the generated plist.)

Start on Login

To start On-Air whenever you log in, you'll need to add the same plist to ~/Library/LaunchAgents. From the on-air directory:

ln -sf $(pwd)/launchd.plist ~/Library/LaunchAgents/com.schoonology.on-air.plist

About

A little script to let you handle when your camera turns on and off.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published