mirror of
https://github.com/dylanaraps/pywal.git
synced 2024-11-25 17:33:09 +01:00
util: Remove broken notifications
This commit is contained in:
parent
775ceccf3a
commit
4090ada879
@ -100,7 +100,7 @@ def create_palette(img, colors, light):
|
|||||||
|
|
||||||
|
|
||||||
def get(img, cache_dir=CACHE_DIR,
|
def get(img, cache_dir=CACHE_DIR,
|
||||||
color_count=COLOR_COUNT, light=False, notify=False):
|
color_count=COLOR_COUNT, light=False):
|
||||||
"""Get the colorscheme."""
|
"""Get the colorscheme."""
|
||||||
# home_dylan_img_jpg_1.2.2.json
|
# home_dylan_img_jpg_1.2.2.json
|
||||||
color_type = "light" if light else "dark"
|
color_type = "light" if light else "dark"
|
||||||
@ -114,13 +114,13 @@ def get(img, cache_dir=CACHE_DIR,
|
|||||||
print("colors: Found cached colorscheme.")
|
print("colors: Found cached colorscheme.")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
util.msg("wal: Generating a colorscheme...", notify)
|
print("wal: Generating a colorscheme...")
|
||||||
|
|
||||||
colors = gen_colors(img, color_count)
|
colors = gen_colors(img, color_count)
|
||||||
colors = create_palette(img, colors, light)
|
colors = create_palette(img, colors, light)
|
||||||
|
|
||||||
util.save_file_json(colors, cache_file)
|
util.save_file_json(colors, cache_file)
|
||||||
util.msg("wal: Generation complete.", notify)
|
print("wal: Generation complete.")
|
||||||
|
|
||||||
return colors
|
return colors
|
||||||
|
|
||||||
|
@ -4,7 +4,6 @@ Misc helper functions.
|
|||||||
import colorsys
|
import colorsys
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import shutil
|
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
|
||||||
@ -141,12 +140,3 @@ def disown(cmd):
|
|||||||
subprocess.Popen(cmd,
|
subprocess.Popen(cmd,
|
||||||
stdout=subprocess.DEVNULL,
|
stdout=subprocess.DEVNULL,
|
||||||
stderr=subprocess.DEVNULL)
|
stderr=subprocess.DEVNULL)
|
||||||
|
|
||||||
|
|
||||||
def msg(input_msg, notify):
|
|
||||||
"""Print to the terminal and display a libnotify
|
|
||||||
notification."""
|
|
||||||
if notify and shutil.which("notify-send"):
|
|
||||||
disown(["notify-send", input_msg])
|
|
||||||
|
|
||||||
print(input_msg)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user