refactor(src/window): replace subprocess.Popen with exec_shell_command_async in dock.py
Use async-friendly API and drop shell=True to enhance safety and performance.
This commit is contained in:
1 file changed
+3
-2
+3
-2
@@ -10,6 +10,7 @@ from fabric.utils import (
|
|||||||
os,
|
os,
|
||||||
random,
|
random,
|
||||||
re,
|
re,
|
||||||
|
exec_shell_command_async,
|
||||||
)
|
)
|
||||||
from fabric.widgets.box import Box
|
from fabric.widgets.box import Box
|
||||||
from fabric.widgets.button import Button
|
from fabric.widgets.button import Button
|
||||||
@@ -443,8 +444,8 @@ class AppBar(Box):
|
|||||||
|
|
||||||
if command_line:
|
if command_line:
|
||||||
cleaned_command = re.sub(r"%\w+", "", command_line).strip()
|
cleaned_command = re.sub(r"%\w+", "", command_line).strip()
|
||||||
final_command = f"hyprctl dispatch exec 'uwsm app -- {cleaned_command}'"
|
final_command = f"hyprctl dispatch 'hl.dsp.exec_cmd([[uwsm app -- {cleaned_command}]])'"
|
||||||
subprocess.Popen(final_command, shell=True)
|
exec_shell_command_async(final_command)
|
||||||
elif hasattr(app_info, "launch"):
|
elif hasattr(app_info, "launch"):
|
||||||
app_info.launch()
|
app_info.launch()
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in new issue
Block a user