feat: 添加按键绑定功能

This commit is contained in:
2026-04-25 05:36:50 +08:00
parent a749fc3c6c
commit 7a86eb469b
14 changed files with 495 additions and 5 deletions

23
src/core/action.c Normal file
View File

@@ -0,0 +1,23 @@
#include "core/action.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);
}