Skip to content

Instantly share code, notes, and snippets.

@timo
Created February 26, 2010 17:17
Show Gist options
  • Save timo/315918 to your computer and use it in GitHub Desktop.
Save timo/315918 to your computer and use it in GitHub Desktop.
import threading
import time
import subprocess
# make the system preload the sound
subprocess.Popen(["mplayer", "/home/timo/.drama/drama.ogg", "-ao", "null"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
def prebuffer_image(image):
open("/home/timo/Pictures/wallpapers/" + image, "r").read()
threading.Thread(target=prebuffer_image, args=("kittenface.jpg",)).start()
threading.Thread(target=prebuffer_image, args=("kitteneye.jpg",)).start()
def playsound():
subprocess.Popen(["mplayer", "/home/timo/.drama/drama.ogg"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
def setBg(stri):
def target():
subprocess.Popen(["feh", "--bg-scale", "/home/timo/Pictures/wallpapers/" + stri])
threading.Thread(target=target).start()
setBg("kitten.jpg")
time.sleep(1)
threading.Thread(target=playsound).start()
time.sleep(0.57)
setBg("kittenface.jpg")
time.sleep(0.23)
setBg("kitteneye.jpg")
time.sleep(3)
setBg("kitten.jpg")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment