config: Added config file.

This commit is contained in:
Dylan Araps 2018-04-01 13:00:37 +10:00
parent d5f39135b2
commit e5781ed69a
2 changed files with 9 additions and 1 deletions

View File

@ -9,6 +9,7 @@
Created by Dylan Araps.
"""
import configparser
import os
import platform
@ -22,3 +23,6 @@ CACHE_DIR = os.path.join(HOME, ".cache", "wal")
MODULE_DIR = os.path.dirname(__file__)
CONF_DIR = os.path.join(HOME, ".config", "wal")
OS = platform.uname()[0]
CONFIG = configparser.ConfigParser()
CONFIG.read("/home/black/.config/wal/config.ini")

View File

@ -5,7 +5,7 @@ import shutil
import subprocess
import urllib.parse
from .settings import CACHE_DIR, HOME, OS
from .settings import CACHE_DIR, HOME, OS, CONFIG
from . import util
@ -124,6 +124,10 @@ def change(img):
if not os.path.isfile(img):
return
if CONFIG.get("wallpaper", "setter"):
util.disown([*CONFIG.get("wallpaper", "setter").split(), img])
return
desktop = get_desktop_env()
if OS == "Darwin":