Files
zdwm/src/base/process.c
Zedhugh Chen 09d5e4b4d0 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
2026-05-27 01:12:04 +08:00

24 lines
368 B
C

#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);
}