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. Created by Dylan Araps.
""" """
import configparser
import os import os
import platform import platform
@ -22,3 +23,6 @@ CACHE_DIR = os.path.join(HOME, ".cache", "wal")
MODULE_DIR = os.path.dirname(__file__) MODULE_DIR = os.path.dirname(__file__)
CONF_DIR = os.path.join(HOME, ".config", "wal") CONF_DIR = os.path.join(HOME, ".config", "wal")
OS = platform.uname()[0] 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 subprocess
import urllib.parse import urllib.parse
from .settings import CACHE_DIR, HOME, OS from .settings import CACHE_DIR, HOME, OS, CONFIG
from . import util from . import util
@ -124,6 +124,10 @@ def change(img):
if not os.path.isfile(img): if not os.path.isfile(img):
return return
if CONFIG.get("wallpaper", "setter"):
util.disown([*CONFIG.get("wallpaper", "setter").split(), img])
return
desktop = get_desktop_env() desktop = get_desktop_env()
if OS == "Darwin": if OS == "Darwin":