This repository has been archived on 2024-08-06. You can view files and clone it, but cannot push or open issues or pull requests.
2013-10-17 14:12:49 +02:00
|
|
|
#!/usr/bin/python
|
2013-10-17 15:21:15 +02:00
|
|
|
import os
|
|
|
|
import threading
|
2013-10-17 14:12:49 +02:00
|
|
|
import time
|
2013-10-17 15:21:15 +02:00
|
|
|
import Queue
|
|
|
|
import signal
|
|
|
|
import subprocess
|
|
|
|
import collections
|
|
|
|
from json_get import generate_list
|
2013-10-17 14:12:49 +02:00
|
|
|
|
2013-10-17 15:21:15 +02:00
|
|
|
q = Queue.Queue()
|
2013-10-17 14:12:49 +02:00
|
|
|
|
2013-10-17 15:21:15 +02:00
|
|
|
ls = collections.deque( generate_list())
|
2013-10-17 14:12:49 +02:00
|
|
|
|
2013-10-17 15:21:15 +02:00
|
|
|
def showstuff():
|
|
|
|
while ( True ):
|
|
|
|
sb = subprocess.Popen(["feh", "-Z", "-g" ,"800x400",ls[0]])
|
|
|
|
while( True ):
|
|
|
|
a = q.get()
|
|
|
|
print a
|
|
|
|
if ( a == "stop" ):
|
|
|
|
sb.terminate()
|
|
|
|
exit()
|
|
|
|
elif ( a == "next"):
|
|
|
|
ls.rotate(1)
|
|
|
|
sb.terminate()
|
|
|
|
break
|
|
|
|
|
2013-10-17 14:12:49 +02:00
|
|
|
|
2013-10-17 15:21:15 +02:00
|
|
|
def amin():
|
|
|
|
showOff = threading.Thread(target=showstuff)
|
|
|
|
showOff.start()
|
|
|
|
for i in range(6):
|
|
|
|
time.sleep(5)
|
|
|
|
q.put("next")
|
|
|
|
time.sleep(2)
|
|
|
|
q.put("stop")
|
2013-10-17 14:12:49 +02:00
|
|
|
|
2013-10-17 15:21:15 +02:00
|
|
|
amin()
|