mirror of
https://github.com/dylanaraps/pywal.git
synced 2025-02-18 03:01:03 +01:00
Merge pull request #94 from dylanaraps/windows
windows: Fix file not found error.
This commit is contained in:
commit
12c52c4b7d
@ -3,6 +3,7 @@ Misc helper functions.
|
|||||||
"""
|
"""
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
|
||||||
@ -111,7 +112,7 @@ def lighten_color(color, amount):
|
|||||||
def disown(cmd):
|
def disown(cmd):
|
||||||
"""Call a system command in the background,
|
"""Call a system command in the background,
|
||||||
disown it and hide it's output."""
|
disown it and hide it's output."""
|
||||||
subprocess.Popen(["nohup", *cmd],
|
subprocess.Popen(cmd,
|
||||||
stdout=subprocess.DEVNULL,
|
stdout=subprocess.DEVNULL,
|
||||||
stderr=subprocess.DEVNULL)
|
stderr=subprocess.DEVNULL)
|
||||||
|
|
||||||
@ -119,7 +120,7 @@ def disown(cmd):
|
|||||||
def msg(input_msg, notify):
|
def msg(input_msg, notify):
|
||||||
"""Print to the terminal and display a libnotify
|
"""Print to the terminal and display a libnotify
|
||||||
notification."""
|
notification."""
|
||||||
if notify:
|
if notify and shutil.which("notify"):
|
||||||
disown(["notify-send", input_msg])
|
disown(["notify-send", input_msg])
|
||||||
|
|
||||||
print(input_msg)
|
print(input_msg)
|
||||||
|
Loading…
Reference in New Issue
Block a user