OS: Added support for Windows

This commit is contained in:
Dylan Araps 2017-08-25 19:39:47 +10:00
parent 93258bdcd8
commit f50cac635e
5 changed files with 5 additions and 5 deletions

1
.gitignore vendored
View File

@ -5,3 +5,4 @@ subprocess
re
build/*
.coverage
.vscode/*

View File

@ -13,7 +13,7 @@ from . import util
def imagemagick(color_count, img):
"""Call Imagemagick to generate a scheme."""
colors = subprocess.Popen(["convert", img, "-resize", "25%",
colors = subprocess.Popen(["magick", "convert", img, "-resize", "25%",
"+dither", "-colors", str(color_count),
"-unique-colors", "txt:-"],
stdout=subprocess.PIPE)

View File

@ -15,7 +15,7 @@ def xrdb(xrdb_file=None):
"""Merge the colors into the X db so new terminals use them."""
xrdb_file = xrdb_file or os.path.join(CACHE_DIR, "colors.Xresources")
if shutil.which("xrdb") or OS != "Darwin":
if shutil.which("xrdb") and OS != "Darwin":
subprocess.Popen(["xrdb", "-merge", xrdb_file],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL).wait()

View File

@ -16,7 +16,7 @@ import platform
__version__ = "0.6.6"
HOME = os.environ["HOME"]
HOME = os.getenv("HOME", os.getenv("USERPROFILE"))
CACHE_DIR = os.path.join(HOME, ".cache/wal/")
MODULE_DIR = os.path.dirname(__file__)
COLOR_COUNT = 16

View File

@ -113,8 +113,7 @@ def disown(cmd):
disown it and hide it's output."""
subprocess.Popen(["nohup", *cmd],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
preexec_fn=os.setpgrp)
stderr=subprocess.DEVNULL)
def msg(input_msg, notify):