-
-
Save Naville/b7b635d82ba520044be031a297efa008 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import plistlib | |
from os.path import expanduser | |
import os | |
BASEPATH=os.path.join(expanduser("~"),"WallpaperKit","WallpaperKit.plist") | |
def absoluteFilePaths(directory): | |
for dirpath,_,filenames in os.walk(directory): | |
for f in filenames: | |
yield os.path.abspath(os.path.join(dirpath, f)) | |
def recursiveSearch(directory): | |
return [os.path.join(root, name) | |
for root, dirs, files in os.walk(directory) | |
for name in files | |
if name.endswith(".DS_Store")==False] | |
Base=dict() | |
Base["WKImagePlugin"]=list() | |
Base["WKVideoPlugin"]=list() | |
Base["WKWebpagePlugin"]=list() | |
Base["WKImageSlideshow"]=list() | |
Base["WEWorkshopPath"]="/Volumes/Maets/SteamLibrary/steamapps/workshop/content/431960" | |
for Path in absoluteFilePaths(os.path.join(expanduser("~"),"Desktop","ActiveWallpapers")): | |
if Path.endswith("DS_Store")==False: | |
Base["WKImagePlugin"].append({"Path":Path}) | |
for Path in absoluteFilePaths(os.path.join(expanduser("~"),"Desktop","BackGroundVideos")): | |
if Path.endswith("DS_Store")==False: | |
Base["WKVideoPlugin"].append({"Path":Path}) | |
IMGS=os.path.join("/Volumes","Tardis","Images") | |
for Path in [os.path.join(IMGS, d) for d in os.listdir(IMGS) if os.path.isdir(os.path.join(IMGS, d))]: | |
if Path.endswith("DS_Store")==False: | |
Base["WKImageSlideshow"].append({"ImagePath":Path,"Interval":5}) | |
plistlib.writePlist(Base,BASEPATH) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment