diff options
| author | Dylan Araps <dylan.araps@gmail.com> | 2017-06-26 12:25:58 +1000 |
|---|---|---|
| committer | Dylan Araps <dylan.araps@gmail.com> | 2017-06-26 12:25:58 +1000 |
| commit | b47dcb1e0df2b6ee39a18e536fa66530fe5066d4 (patch) | |
| tree | 052892079eb35f07cfc1b52ff903e9089b064b4d /pywal/util.py | |
| parent | 3d1627f3c772fef0e24aa1303ff0982b8a7242ed (diff) | |
General: Generalise functions.
Diffstat (limited to 'pywal/util.py')
| -rw-r--r-- | pywal/util.py | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/pywal/util.py b/pywal/util.py index 061c94e..3990fbd 100644 --- a/pywal/util.py +++ b/pywal/util.py @@ -4,9 +4,6 @@ Misc helper functions. import os import pathlib import subprocess -import shutil - -from pywal import settings as s def read_file(input_file): @@ -20,9 +17,9 @@ def save_file(colors, export_file): file.write(colors) -def create_cache_dir(): +def create_dir(directory): """Alias to create the cache dir.""" - pathlib.Path(s.CACHE_DIR / "schemes").mkdir(parents=True, exist_ok=True) + pathlib.Path(directory).mkdir(parents=True, exist_ok=True) def hex_to_rgb(color): @@ -36,15 +33,6 @@ def fix_escape(string): return bytes(string, "utf-8").decode("unicode_escape") -def notify(msg): - """Send arguements to notify-send.""" - if shutil.which("notify-send") and s.Args.notify: - subprocess.Popen(["notify-send", msg], - stdout=subprocess.DEVNULL, - stderr=subprocess.DEVNULL, - preexec_fn=os.setpgrp) - - def disown(*cmd): """Call a system command in the background, disown it and hide it's output.""" |
