From 189f5694b7469432206f92cfef6410bfe09a7ef3 Mon Sep 17 00:00:00 2001 From: Faugus <112667550+Faugus@users.noreply.github.com> Date: Fri, 1 Nov 2024 18:43:47 -0300 Subject: [PATCH] Reworked kill command --- faugus-launcher.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/faugus-launcher.py b/faugus-launcher.py index 13e3a38..379bb3b 100644 --- a/faugus-launcher.py +++ b/faugus-launcher.py @@ -519,9 +519,11 @@ class Main(Gtk.Window): def on_button_kill_clicked(self, widget): # Handle kill button click event - subprocess.run(r"ls -l /proc/*/exe 2>/dev/null | grep -E 'wine(64)?-preloader|wineserver' | perl " - r"-pe 's;^.*/proc/(\d+)/exe.*$;$1;g;' | xargs -n 1 kill | killall -s9 winedevice.exe tee", - shell=True) + subprocess.run(r""" + for pid in $(ls -l /proc/*/exe 2>/dev/null | grep -E 'wine(64)?-preloader|wineserver|winedevice.exe' | awk -F'/' '{print $3}'); do + kill -9 "$pid" + done +""", shell=True) self.game_running = None self.game_running2 = False