From d887e22f0bf57ae9a8ecd1867733a992aad72ff2 Mon Sep 17 00:00:00 2001 From: S4NKALP Date: Tue, 16 Jun 2026 22:24:36 +0545 Subject: [PATCH] refactor(src/window/launcher/plugins): migrate subprocess calls to exec_shell_command_asyncUse unified async execution and updated hyprctl dispatch syntax --- src/window/launcher/plugins/applications.py | 15 +++++++++++---- src/window/launcher/plugins/power.py | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/window/launcher/plugins/applications.py b/src/window/launcher/plugins/applications.py index fa272a8..0e3f654 100644 --- a/src/window/launcher/plugins/applications.py +++ b/src/window/launcher/plugins/applications.py @@ -1,8 +1,13 @@ import json -import subprocess from typing import List -from fabric.utils import DesktopApp, get_desktop_applications, get_relative_path, re +from fabric.utils import ( + DesktopApp, + get_desktop_applications, + get_relative_path, + re, + exec_shell_command_async, +) from utils.roam import modus_service from window.launcher.plugin_base import PluginBase @@ -146,8 +151,10 @@ class ApplicationsPlugin(PluginBase): cleaned_command = re.sub(r"%\w+", "", app.command_line).strip() # Final command with hyprctl dispatch - final_command = f"hyprctl dispatch exec 'uwsm app -- {cleaned_command}'" - subprocess.Popen(final_command, shell=True) + final_command = ( + f"hyprctl dispatch 'hl.dsp.exec_cmd([[uwsm app -- {cleaned_command}]])'" + ) + exec_shell_command_async(final_command) # app.launch() diff --git a/src/window/launcher/plugins/power.py b/src/window/launcher/plugins/power.py index d6c2dd5..7c05d5d 100644 --- a/src/window/launcher/plugins/power.py +++ b/src/window/launcher/plugins/power.py @@ -99,4 +99,4 @@ class PowerPlugin(PluginBase): exec_shell_command_async("systemctl suspend") def logout(self, *args) -> None: - exec_shell_command_async("hyprctl dispatch exit") + exec_shell_command_async("hyprctl dispatch 'hl.dsp.exit()'")