mirror of
https://github.com/dylanaraps/pywal.git
synced 2024-11-28 19:03:17 +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 logging
|
||||
import os
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
@ -178,6 +179,9 @@ def disown(cmd):
|
||||
|
||||
def get_pid(name):
|
||||
"""Check if process is running by name."""
|
||||
if not shutil.which("pidof"):
|
||||
return False
|
||||
|
||||
try:
|
||||
subprocess.check_output(["pidof", "-s", name])
|
||||
except subprocess.CalledProcessError:
|
||||
|
Loading…
Reference in New Issue
Block a user