refactor(policy): 删除 action 模块,将 action -> command 解析放在 policy 模块内部
- 删除 src/core/action.c|h,将 spawn 移至 src/base/process - policy_resolve_action 实现完整的 action 分发逻辑 - binding_table_cycle_mode 改为纯计算,返回模式 ID 而非修改状态 - 从 state 移除 state_workspace_cycle_layout / state_cycle_current_output - 新增 ZDWM_COMMAND_QUIT 命令,通过 plan 标志驱动 runtime 退出 - set_binding_mode 现在生成 BIND_KEY effect 以同步后端按键绑定 - 扩展 action 数据类型支持 window_send_to_workspace 和 window_cycle_output
This commit is contained in:
23
src/base/process.c
Normal file
23
src/base/process.c
Normal file
@@ -0,0 +1,23 @@
|
||||
#include "base/process.h"
|
||||
|
||||
#include <paths.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "base/log.h"
|
||||
|
||||
void spawn(const char *command) {
|
||||
if (fork() == 0) {
|
||||
setsid();
|
||||
|
||||
if (fork() == 0) {
|
||||
execl(_PATH_BSHELL, _PATH_BSHELL, "-c", command, nullptr);
|
||||
fatal("execl fail: %s", command);
|
||||
}
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
wait(0);
|
||||
}
|
||||
3
src/base/process.h
Normal file
3
src/base/process.h
Normal file
@@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
|
||||
void spawn(const char *command);
|
||||
Reference in New Issue
Block a user