I trying to find a script that can use fbsetbg and change the background ramdomly through directories
i found
this python script and changed it to the following , but it gives me errors , i think its because there are directories in directories
here is my modified version
Code:
# Copyright 2005 Michael Rice
# errr (at) errr-online (dot) com
#
# This will set a random image. It will pull the image from a pool
# of as many dirs as you want and its timed and will change every 2 mins
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
import os,random
from time import sleep
def get_bgimgs():
h = []
#add your paths here no need to remove any if you dont want to
#any path that isnt there will be skipped
paths =["/mnt/allix/photos"]
for imgpth in paths:
try:
imgs = os.listdir(os.path.expanduser(imgpth))
for i in imgs:
i = i.replace(" ","/ ")
h.append(imgpth+"/"+i)
except (OSError):
pass
os.system("fbsetbg -f "+ random.choice(h))
sleep(240)
#print random.choice(h)
if __name__ == "__main__":
while 1:
get_bgimgs()