refactor(src/window/launcher/plugins): migrate subprocess calls to exec_shell_command_asyncUse unified async execution and updated hyprctl dispatch syntax

This commit is contained in:
sankalp committed 2026-06-16 22:24:36 +05:45
1 parent 7371b4fcb8
commit d887e22f0b
2 files changed
+12 -5

No files matched your search

+11 -4
View File
@@ -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()
+1 -1
View File
@@ -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()'")