Fix xkopher link focus and unlock clock; battery longevity pass

Map xkopher link focus through wrapped display rows and reset horizontal scroll in no-wrap mode. Refresh the status bar clock on unlock and from dmenu before republishing root WM_NAME. Re-analysis found two low-risk wins: force lz4 for the active zram swap and disable proactive compaction. Rebuild dmenu.so and smallweb.so, update guards and docs, redeploy live, and rebuild the image.
This commit is contained in:
Luxferre committed 2026-11-08 08:45:53 +02:00
1 parent 85c6a7b886
commit 3543556735
22 files changed
+402 -54

No files matched your search

+58 -6
View File
@@ -327,30 +327,81 @@ t9_mode_badge(int mode)
}
}
static void
refresh_status_time(const char *status_dir)
{
char path[512], tbuf[128];
const char *fmt = getenv("SXMO_STATUS_DATE_FORMAT");
time_t now;
struct tm lt;
FILE *fp;
if (!fmt || !*fmt)
fmt = "%H:%M";
now = time(NULL);
if (!localtime_r(&now, &lt))
return;
if (!strftime(tbuf, sizeof(tbuf), fmt, &lt))
return;
snprintf(path, sizeof(path), "%s/099-time", status_dir);
fp = fopen(path, "w");
if (fp) {
fprintf(fp, " %s\n", tbuf);
fclose(fp);
}
}
static void
write_status_cache(const char *base, const char *status_line)
{
char path[512];
FILE *fp;
snprintf(path, sizeof(path), "%s/sxmo_status_bar_cache", base);
fp = fopen(path, "w");
if (fp) {
fprintf(fp, "%s\n", status_line);
fclose(fp);
}
}
static void
update_t9_status_indicator(void)
{
const char *rdir = getenv("XDG_RUNTIME_DIR");
const char *base = (rdir && rdir[0]) ? rdir : "/run/user/10000";
const char *status_name = getenv("SXMO_STATUS_NAME");
const char *badge = t9_mode_badge(t9_mode);
char path[256];
char path[512], status_dir[512];
FILE *fp;
if (!status_name || !*status_name)
status_name = "default";
snprintf(path, sizeof(path), "%s/sxmo_status", base);
mkdir(path, 0755);
snprintf(status_dir, sizeof(status_dir), "%s/sxmo_status/%s", base,
status_name);
mkdir(status_dir, 0755);
snprintf(path, sizeof(path), "%s/sxmo_t9_mode", base);
FILE *fp = fopen(path, "w");
fp = fopen(path, "w");
if (fp) {
fprintf(fp, "%s\n", badge);
fclose(fp);
}
snprintf(path, sizeof(path), "%s/sxmo_status/default/005-input-method", base);
snprintf(path, sizeof(path), "%s/005-input-method", status_dir);
fp = fopen(path, "w");
if (fp) {
fprintf(fp, "%s\n", badge);
fclose(fp);
}
/* The statusbar hook skips periodics while the panel is dark. Refresh the
* clock here so opening dmenu or changing T9 mode after unlock cannot
* republish a stale root WM_NAME from the cached status files. */
refresh_status_time(status_dir);
if (dpy && root) {
char status_dir[256];
snprintf(status_dir, sizeof(status_dir), "%s/sxmo_status/default", base);
DIR *dir = opendir(status_dir);
if (dir) {
char names[32][64];
@@ -377,7 +428,7 @@ update_t9_status_indicator(void)
size_t pos = 0;
status_line[0] = '\0';
for (int i = 0; i < count; i++) {
char fpath[320];
char fpath[640];
snprintf(fpath, sizeof(fpath), "%s/%s", status_dir, names[i]);
FILE *sfp = fopen(fpath, "r");
if (!sfp)
@@ -398,6 +449,7 @@ update_t9_status_indicator(void)
fclose(sfp);
}
if (pos > 0) {
write_status_cache(base, status_line);
XStoreName(dpy, root, status_line);
XFlush(dpy);
}