script path
This commit is contained in:
parent
989fd74606
commit
74ad926cbc
@ -3,6 +3,7 @@
|
|||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import psutil
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import curses
|
import curses
|
||||||
@ -584,7 +585,7 @@ class ControlsWindow(Window, ControlsParser):
|
|||||||
|
|
||||||
|
|
||||||
class Music:
|
class Music:
|
||||||
PATH = "music.sh"
|
PATH = os.path.join(os.path.dirname(__file__), "music.sh")
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.process = None
|
self.process = None
|
||||||
@ -594,7 +595,8 @@ class Music:
|
|||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
if self.process:
|
if self.process:
|
||||||
subprocess.run(['pkill', '-P', str(self.process.pid)])
|
for proc in psutil.Process(self.process.pid).children(recursive=True):
|
||||||
|
proc.terminate()
|
||||||
self.process.terminate()
|
self.process.terminate()
|
||||||
self.process = None
|
self.process = None
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user