feat(x11): disable X screensaver/DPMS blanking and enforce explicit-only locking

This commit is contained in:
Luxferre
2026-10-22 22:15:28 +03:00
parent c646800dbf
commit 179cc3066b
20 changed files with 38 additions and 227 deletions
-21
View File
@@ -839,23 +839,6 @@ handle_builtin_toggle(const char *toggle_name)
if (fd >= 0)
close(fd);
}
} else if (strcmp(toggle_name, "autoscreenoff") == 0) {
const char *home = getenv("HOME");
if (!home || !home[0])
home = "/home/user";
char path[256];
snprintf(path, sizeof(path), "%s/.cache/sxmo/sxmo.noidle", home);
if (access(path, F_OK) == 0) {
unlink(path);
} else {
char dir[256];
snprintf(dir, sizeof(dir), "%s/.cache/sxmo", home);
mkdir(dir, 0755);
int fd = open(path, O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC, 0644);
if (fd >= 0)
close(fd);
}
spawn_detached_sh("sxmo_state.sh set unlock");
} else if (strcmp(toggle_name, "bluetooth") == 0) {
int rc = system("doas sxmo_bluetoothtoggle.sh >/dev/null 2>&1");
(void)rc;
@@ -1829,10 +1812,6 @@ open_builtin_menu(const char *menu_name, int keep_idx)
snprintf(label, sizeof(label), "%s Auto-suspend %s", ICON_ZZZ, (access(pbuf, F_OK) == 0) ? ICON_TOF : ICON_TON);
add_menu_item(label, "@toggle:autosuspend", 1);
snprintf(pbuf, sizeof(pbuf), "%s/.cache/sxmo/sxmo.noidle", home);
snprintf(label, sizeof(label), "%s Auto-screen-off %s", ICON_ZZZ, (access(pbuf, F_OK) == 0) ? ICON_TOF : ICON_TON);
add_menu_item(label, "@toggle:autoscreenoff", 1);
snprintf(label, sizeof(label), "%s Hooks", ICON_TRM);
add_menu_item(label, "sxmo_hookmenu.sh", 0);
snprintf(label, sizeof(label), "%s Suspend Blockers", ICON_CFG);