diff --git a/configure.py b/configure.py index d98dab21..052db5d0 100755 --- a/configure.py +++ b/configure.py @@ -364,14 +364,17 @@ def on_theme_change(self, e=None): self.load_theme_preview() def on_theme_editor_click(self): - subprocess.Popen(os.path.join(os.getcwd(), "theme-editor.py") + " \"" + self.theme_cb.get() + "\"", shell=True) + subprocess.Popen([sys.executable, os.path.join(os.getcwd(), "theme-editor.py"), self.theme_cb.get()]) def on_save_click(self): self.save_config_values() def on_saverun_click(self): self.save_config_values() - subprocess.Popen(os.path.join(os.getcwd(), "main.py"), shell=True) + kwargs = {} + if hasattr(subprocess, "DETACHED_PROCESS"): + kwargs["creationflags"] = subprocess.DETACHED_PROCESS + subprocess.Popen([sys.executable, os.path.join(os.getcwd(), "main.py")], **kwargs) self.window.destroy() def on_brightness_change(self, e=None): diff --git a/main.py b/main.py index 0402f6e7..8218b616 100755 --- a/main.py +++ b/main.py @@ -108,7 +108,10 @@ def on_signal_caught(signum, frame=None): def on_configure_tray(tray_icon, item): logger.info("Configure from tray icon") - subprocess.Popen(os.path.join(os.getcwd(), "configure.py"), shell=True) + kwargs = {} + if hasattr(subprocess, "DETACHED_PROCESS"): + kwargs["creationflags"] = subprocess.DETACHED_PROCESS + subprocess.Popen([sys.executable, os.path.join(os.getcwd(), "configure.py")], **kwargs) clean_stop(tray_icon)