mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-01-25 23:39:01 +01:00
??
This commit is contained in:
parent
979b669a8c
commit
37d6823af3
@ -7,8 +7,8 @@ import shutil
|
|||||||
import subprocess
|
import subprocess
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
|
|
||||||
import settings
|
from .settings import HOME, OS, CACHE_DIR
|
||||||
import util
|
from . import util
|
||||||
|
|
||||||
|
|
||||||
def get_desktop_env():
|
def get_desktop_env():
|
||||||
@ -134,7 +134,7 @@ def set_desktop_wallpaper(desktop, img):
|
|||||||
def set_mac_wallpaper(img):
|
def set_mac_wallpaper(img):
|
||||||
"""Set the wallpaper on macOS."""
|
"""Set the wallpaper on macOS."""
|
||||||
db_file = "Library/Application Support/Dock/desktoppicture.db"
|
db_file = "Library/Application Support/Dock/desktoppicture.db"
|
||||||
db_path = os.path.join(settings.HOME, db_file)
|
db_path = os.path.join(HOME, db_file)
|
||||||
img_dir, _ = os.path.split(img)
|
img_dir, _ = os.path.split(img)
|
||||||
|
|
||||||
# Clear the existing picture data and write the image paths
|
# Clear the existing picture data and write the image paths
|
||||||
@ -173,19 +173,19 @@ def change(img):
|
|||||||
|
|
||||||
desktop = get_desktop_env()
|
desktop = get_desktop_env()
|
||||||
|
|
||||||
if settings.OS == "Darwin":
|
if OS == "Darwin":
|
||||||
set_mac_wallpaper(img)
|
set_mac_wallpaper(img)
|
||||||
|
|
||||||
elif settings.OS == "Windows":
|
elif OS == "Windows":
|
||||||
set_win_wallpaper(img)
|
set_win_wallpaper(img)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
set_desktop_wallpaper(desktop, img)
|
set_desktop_wallpaper(desktop, img)
|
||||||
|
|
||||||
logging.info("Desktop is " + desktop)
|
logging.info("Set the new wallpaper.")
|
||||||
|
|
||||||
|
|
||||||
def get(cache_dir=settings.CACHE_DIR):
|
def get(cache_dir=CACHE_DIR):
|
||||||
"""Get the current wallpaper."""
|
"""Get the current wallpaper."""
|
||||||
current_wall = os.path.join(cache_dir, "wal")
|
current_wall = os.path.join(cache_dir, "wal")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user