Projects/pensieve
Projects
/
pensieve
Archived
3
0
Fork 0
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.
pensieve/pensieve.py

40 lines
789 B
Python
Raw Permalink Normal View History

#!/usr/bin/python
2013-10-17 15:21:15 +02:00
import os
import threading
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 15:21:15 +02:00
q = Queue.Queue()
2013-10-17 15:21:15 +02:00
ls = collections.deque( generate_list())
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 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 15:21:15 +02:00
amin()