mirror of
https://github.com/dylanaraps/pywal.git
synced 2024-11-29 03:13:47 +01:00
reload: Fix error if pidof not installed
This commit is contained in:
parent
984c7b640e
commit
f88dca706f
@ -5,6 +5,7 @@ import colorsys
|
|||||||
import json
|
import json
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
@ -178,6 +179,9 @@ def disown(cmd):
|
|||||||
|
|
||||||
def get_pid(name):
|
def get_pid(name):
|
||||||
"""Check if process is running by name."""
|
"""Check if process is running by name."""
|
||||||
|
if not shutil.which("pidof"):
|
||||||
|
return False
|
||||||
|
|
||||||
try:
|
try:
|
||||||
subprocess.check_output(["pidof", "-s", name])
|
subprocess.check_output(["pidof", "-s", name])
|
||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
|
Loading…
Reference in New Issue
Block a user