Add callscreen DWM plugin for incoming and active voice calls

This commit is contained in:
Luxferre
2026-10-22 10:17:24 +03:00
parent cbac6743bc
commit 6e58218e10
38 changed files with 2120 additions and 38 deletions
+17 -8
View File
@@ -631,16 +631,20 @@ int calllog_plugin_init(const DwmHostApi* host) {
int calllog_on_global_key(const DwmHostApi* host, KeySym keysym,
unsigned int keycode, unsigned int state,
int is_press) {
(void)host;
if (!is_press || state != 0) {
return 0;
}
if (keysym == XF86XK_Phone || keysym == XF86XK_PickupPhone || keycode == 177) {
if (isCallRingingFast()) {
const char* const argv[] = {"sxmo_hook_pickup.sh", nullptr};
if (host && host->spawn_command) {
host->spawn_command(argv);
} else {
runAsyncArgv("sxmo_hook_pickup.sh");
if (!sendPluginCommand("callscreen", "ACCEPT")) {
runAsyncArgv("xcallscreen", "accept");
}
return 1;
}
if (isCallActiveOrRingingFast()) {
if (!sendPluginCommand("callscreen", "OPEN")) {
runAsyncArgv("xcallscreen");
}
return 1;
}
@@ -655,9 +659,14 @@ int calllog_on_idle_key(const DwmHostApi* host, KeySym keysym,
}
if (keysym == XF86XK_Phone || keysym == XF86XK_PickupPhone || keycode == 177) {
if (isCallRingingFast()) {
const char* const argv[] = {"sxmo_hook_pickup.sh", nullptr};
if (host->spawn_command) {
host->spawn_command(argv);
if (!sendPluginCommand("callscreen", "ACCEPT")) {
runAsyncArgv("xcallscreen", "accept");
}
return 1;
}
if (isCallActiveOrRingingFast()) {
if (!sendPluginCommand("callscreen", "OPEN")) {
runAsyncArgv("xcallscreen");
}
return 1;
}