https://github.com/v-adhithyan/itunes-controller
Detect face and enable iTunes playback. :sunglasses:
https://github.com/v-adhithyan/itunes-controller
Last synced: about 2 months ago
JSON representation
Detect face and enable iTunes playback. :sunglasses:
- Host: GitHub
- URL: https://github.com/v-adhithyan/itunes-controller
- Owner: v-adhithyan
- License: mit
- Created: 2016-09-03T12:16:58.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-11-27T05:58:37.000Z (over 8 years ago)
- Last Synced: 2025-04-11T14:09:12.597Z (2 months ago)
- Language: Python
- Homepage:
- Size: 297 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# itunes-controller
[](https://pypi.python.org/pypi/itunescontroller/0.5)[](https://github.com/v-adhithyan/awesome-chrome-extensions/blob/master/LICENSE)
Play/Pause itunes with face.
## Motivation
One fine day, I was hearing songs with my headphones on and suddenly I wanted to go bathroom. A good song was playing and I needed to pause it in iTunes before going to bathroom. So, i thought what if iTunes plays only if a person is in front of the system. Then i hunted for the software. I was unable to find one. So i made this.
## Installation
Package is available via pip. Please install as sudo. Otherwise it won't work.
```
$ sudo pip install itunescontroller
```* **Runs only on macOS**.
## Screenshots
* When you are away, you will get a notification indicating itunes has paused.
* When you are back, you will get a notification indicating itunes has started playing.
## Working
The package is a combination of python, plist and applescript.
* [itunescontroller](https://github.com/v-adhithyan/itunes-controller/blob/master/itunescontroller/__init__.py) utility just detects face using **open cv haarcascade classifer** and says **"face"** if a face is detected and **"no face"** if a face is not detected.
* On installation using pip, a folder .itunescontroller is created in user home and a applescript is copied to that folder. The applescript checks if itunes is running. If itunes is running, it calls itunescontroller utility for face detection. If result is no face and if itunes is playing, it will be paused and if the result is face and if itunes is not playing, it will start playing.
* After installation, a [**plist**](https://github.com/v-adhithyan/itunes-controller/blob/master/hook/me.adhithyan.iTunescontroller.plist) is created in **/Library/LaunchAgents** which invokes applescript which controls iTunes.
* The utility will continuosly run in background for every 15 seconds.
## To do
- [ ] Check whether it is working in Python 3.
## License
Released under MIT license.