Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env python
import flicklib
import subprocess
from time import sleep
from copy import copy
@flicklib.move()
def move(x, y, z):
global xyz
xyz = [x,y,z]
def main():
global xyz
xyz = [0,0,0]
old_xyz = [0,0,0]
while True:
if old_xyz != xyz:
print 'Detected movement. Sending Bat-signal to Screenly!'
subprocess.call(['pkill', '-SIGUSR1', '-f', 'viewer.py'])
sleep(1)
old_xyz = copy(xyz)
sleep(0.3)
if __name__ == "__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.