From 673ee72dbcb57384c7d402b9cbd56d7d217e5327 Mon Sep 17 00:00:00 2001 From: Luxferre Date: Tue, 20 Oct 2026 21:38:49 +0300 Subject: [PATCH] fix(x11,docs): use busctl+pkcheck for polkit power actions, increase st font to 18px, and format README overview list --- MANUAL.md | 2 +- README.md | 14 ++++++++++++- overlay/rootfs/etc/skel/.Xresources | 2 +- overlay/rootfs/home/user/.Xresources | 2 +- overlay/rootfs/usr/bin/st | Bin 64004 -> 64004 bytes overlay/rootfs/usr/bin/sxmo_power.sh | 19 ++++++++++++++---- .../rootfs/usr/share/sxmo/appcfg/Xresources | 2 +- prebuilt/sxmo-x11/usr/bin/st | Bin 64004 -> 64004 bytes src/sxmo-st/config.def.h | 2 +- src/sxmo-st/config.h | 2 +- 10 files changed, 34 insertions(+), 11 deletions(-) diff --git a/MANUAL.md b/MANUAL.md index 5964a47..1ad37ad 100644 --- a/MANUAL.md +++ b/MANUAL.md @@ -26,7 +26,7 @@ This manual covers flashing, operating, and customizing **Bananarchy Linux** (`v 1. **Native 1:1 `240x320` resolution, cross-compiled Xlibre, `Fira Code` ligatures & ultra-low-latency Sxmo X11 UI**: - **Cross-compiled Xlibre (`X11Libre/xserver` 25.2.0)**: compiled specifically for ARMv7 Cortex-A7 (`-O2 -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -fno-plt -fomit-frame-pointer`) with all 3D/GLX/Glamor/VGA/DGA/XVideo bloat stripped out, rootless `elogind` device management, and `modesetting` KMS + `ShadowFB` (`drmModeDirtyFB` partial rectangle SPI updates) with automatic software cursor fallback on `/dev/dri/card0` (`panel-mipi-dbi`). - **Non-Nerd `Fira Code` with OpenType ligatures**: `Fira Code` (`font-fira-code`) is configured as the primary system and terminal font across Fontconfig, Xft, `st`, `dmenu`, `dwm`, `conky`, and `dunst`, with `DejaVu SansM Nerd Font` used strictly as a fallback for Private Use Area icon glyphs. - - **Patched `sxmo-st` (`st`) with HarfBuzz ligatures & XIM**: patched with `libharfbuzz` (`hb.c`/`hb.h`) shaping (`liga`, `calt`, `clig`, `dlig`) so multi-character programming operators (`->`, `=>`, `!=`, `<=`, `>=`, `===`, `::`, `//`, `/*`) render as continuous ligatures at `pixelsize=15`, alongside full `XIM` (`fcitx5-t9`) input support. + - **Patched `sxmo-st` (`st`) with HarfBuzz ligatures & XIM**: patched with `libharfbuzz` (`hb.c`/`hb.h`) shaping (`liga`, `calt`, `clig`, `dlig`) so multi-character programming operators (`->`, `=>`, `!=`, `<=`, `>=`, `===`, `::`, `//`, `/*`) render as continuous ligatures at `pixelsize=18`, alongside full `XIM` (`fcitx5-t9`) input support. - **Patched `sxmo-dmenu` (`dmenu`) (`< 15 ms` startup)**: full-width `240x320` 9-line vertical menu (`lineheight = 26`, positioned flush at `Y = 24` right below the 24px `dwm` bar) with a `#383838` top search bar, `#005577` prompt badge, `#1c1c1c` item list, `XIM` (`XSetLocaleModifiers("")`, `XSetICFocus`, `Xutf8LookupString`) for live `fcitx5-t9` search filtering and `#` mode switching, C-level focus preservation (`prevfocuswin`), and direct Nokia keypad bindings. - **Patched `sxmo-dwm` (`dwm`) (`< 2 ms` display wake/unlock)**: configured for `240x320` (`bh = 24`, `#323232` top bar, `#005577` active tag/border, vertical `bstack` layout default, overflow-protected Pango status bar rendering keeping the right-aligned clock always visible). Directly polls `/dev/input/by-path/platform-gpio-keys-event` (`SW_LID`) and intercepts locked-state wake keys (`XF86PowerOff`, `XF86PickupPhone`, `XF86KbdLcdMenu1`, `XF86KbdLcdMenu2`) in C to toggle `/sys/class/backlight/backlight/brightness` and `/sys/class/leds/white:kbd_backlight/brightness` in `< 2 ms` before running Sxmo state hooks asynchronously. 2. **Multi-mode `fcitx5-t9` keypad engine (`src/fcitx5-t9/`)**: diff --git a/README.md b/README.md index 805bece..a891942 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,19 @@ See [The Bananarchy Manifesto](./MANIFESTO.md) for the rationale behind this entire project. -Bananarchy targets an ultra-lightweight **Sxmo X11 (`sxmo-de-dwm`)** environment (with all Wayland components removed) powered by a cross-compiled **Xlibre (`X11Libre/xserver` 25.2.0)** display server (`modesetting` KMS + `ShadowFB` Damage partial-rectangle SPI transfers, software cursor fallback, rootless `elogind`), **patched `sxmo-dwm`** (`240x320` vertical `bstack` layout, 24px Pango status bar with overflow-protected right-aligned clock, direct C `SW_LID` slider and locked-key wake handling in `< 2 ms`), **patched `sxmo-dmenu`** (`240x320` full-width 9-line vertical menu flush below the 24px top bar with `#383838` search bar, `#005577` prompt badge, and `XIM` `fcitx5-t9` text input in `< 15 ms`), **patched `sxmo-st`** terminal (`pixelsize=15`) with **HarfBuzz (`libharfbuzz`) OpenType ligature shaping** (`liga`, `calt`, `clig`, `dlig`) and `XIM` support, and **non-Nerd `Fira Code` (`font-fira-code`) with ligatures** as the primary system and terminal font (with `DejaVu SansM Nerd Font` used strictly as an icon fallback). It features a sub-95 MB idle RAM footprint on 512 MB devices, full Qualcomm QDSP6/Q6Voice audio (loudspeaker, earpiece speaker, and internal/headset microphones with PM8909 WCD analog codec 2.8V micbias and +6 dB EAR PA gain), GSM/WCDMA/LTE modem routing (`ModemManager` + `q6voiced`), rear 2MP camera support (`msm8905-cam` V4L2 driver for GalaxyCore `GC2395` + MSM8909 `CAMSS` on `/dev/video0` and `bananarchy-photo` CLI/Sxmo app), pre-integrated **Bantam** AI agent (`https://code.luxferre.top/luxferre/bantam-cpp`), a complete on-device development & scripting stack (`git`, `gcc`/`g++`, `make`, `nano`, `janet` + `jpm`, `perl` + `IO::Socket::SSL`, `tcl` + `tcllib`/`tcl-tls`/`sqlite-tcl`, `sqlite`, `i2c-tools`, `v4l-utils`), and a custom **6-mode `fcitx5-t9` input engine** with a fixed bottom candidate bar (`X=1, Y=290, W=238, H=30`) supporting lowercase, one-shot Shift, Caps Lock, all 32 ASCII punctuation symbols, terminal control codes (`^A`-`^Z`, `Esc`, `Tab`, `F1`-`F12`), and direct numeric entry with live top-bar mode indication (`[abc]`, `[Abc]`, `[ABC]`, `[Sym]`, `[Ctl]`, `[123]`). +Bananarchy targets an ultra-lightweight **Sxmo X11 (`sxmo-de-dwm`)** environment (with all Wayland components removed), featuring: + +- **Cross-compiled Xlibre (`X11Libre/xserver` 25.2.0) display server**: `modesetting` KMS + `ShadowFB` Damage partial-rectangle SPI transfers, software cursor fallback, and rootless `elogind` integration. +- **Patched `sxmo-dwm`**: `240x320` vertical `bstack` layout, 24px Pango status bar with an overflow-protected right-aligned clock, and direct C `SW_LID` slider and locked-key wake handling in `< 2 ms`. +- **Patched `sxmo-dmenu`**: `240x320` full-width 9-line vertical menu flush below the 24px top bar with a `#383838` search bar, `#005577` prompt badge, and `XIM` `fcitx5-t9` text input in `< 15 ms`. +- **Patched `sxmo-st` terminal (`pixelsize=18`)**: **HarfBuzz (`libharfbuzz`) OpenType ligature shaping** (`liga`, `calt`, `clig`, `dlig`) and `XIM` support. +- **Typography**: non-Nerd **`Fira Code` (`font-fira-code`) with ligatures** as the primary system and terminal font (with `DejaVu SansM Nerd Font` used strictly as an icon fallback). +- **Custom 6-mode `fcitx5-t9` input engine**: fixed bottom candidate bar (`X=1, Y=290, W=238, H=30`) with a constant 28-character monospace preedit layout supporting lowercase, one-shot Shift, Caps Lock, all 32 ASCII punctuation symbols, terminal control codes (`^A`-`^Z`, `Esc`, `Tab`, `F1`-`F12`), and direct numeric entry with live top-bar mode indication (`[abc]`, `[Abc]`, `[ABC]`, `[Sym]`, `[Ctl]`, `[123]`). +- **Low memory footprint**: sub-95 MB idle RAM usage on 512 MB devices. +- **Full Qualcomm QDSP6/Q6Voice audio & modem routing**: loudspeaker, earpiece speaker, and internal/headset microphones with PM8909 WCD analog codec 2.8V micbias, +6 dB EAR PA gain, and GSM/WCDMA/LTE voice routing (`ModemManager` + `q6voiced`). +- **Rear 2MP camera support**: `msm8905-cam` V4L2 driver for GalaxyCore `GC2395` + MSM8909 `CAMSS` on `/dev/video0` and the `bananarchy-photo` CLI/Sxmo app. +- **Pre-integrated Bantam AI agent**: cross-compiled from `https://code.luxferre.top/luxferre/bantam-cpp`. +- **Complete on-device development & scripting stack**: `git`, `gcc`/`g++`, `make`, `nano`, `janet` + `jpm`, `perl` + `IO::Socket::SSL`, `tcl` + `tcllib`/`tcl-tls`/`sqlite-tcl`, `sqlite`, `i2c-tools`, and `v4l-utils`. The current Bananarchy version is `v0.0.1`. diff --git a/overlay/rootfs/etc/skel/.Xresources b/overlay/rootfs/etc/skel/.Xresources index 0f52a38..b15c5cb 100644 --- a/overlay/rootfs/etc/skel/.Xresources +++ b/overlay/rootfs/etc/skel/.Xresources @@ -15,7 +15,7 @@ dwm.selbgcolor: #005577 dwm.selbordercolor: #005577 dwm.selfgcolor: #ffffff -st.font: Fira Code:pixelsize=13:antialias=true:autohint=true +st.font: Fira Code:pixelsize=18:style=Regular:antialias=true:autohint=true st.background: #1c1c1c st.foreground: #e5e5e5 st.cursorColor: #cccccc diff --git a/overlay/rootfs/home/user/.Xresources b/overlay/rootfs/home/user/.Xresources index 1c20b87..b15c5cb 100644 --- a/overlay/rootfs/home/user/.Xresources +++ b/overlay/rootfs/home/user/.Xresources @@ -15,7 +15,7 @@ dwm.selbgcolor: #005577 dwm.selbordercolor: #005577 dwm.selfgcolor: #ffffff -st.font: Fira Code:pixelsize=15:style=Regular:antialias=true:autohint=true +st.font: Fira Code:pixelsize=18:style=Regular:antialias=true:autohint=true st.background: #1c1c1c st.foreground: #e5e5e5 st.cursorColor: #cccccc diff --git a/overlay/rootfs/usr/bin/st b/overlay/rootfs/usr/bin/st index 83b666c538d9051309a7702b0f4bb78b698afd04..c2753951c11b201595c3575f77d3779cabe7846c 100755 GIT binary patch delta 42 zcmV+_0M-A5^aF(S1F%E^6kvmO_4KD4{zdPY0<8h-#q+OOU9(sL>COQ-vqI3qDa3FU AG5`Po delta 42 zcmV+_0M-A5^aF(S1F%E^6h2nf)N+J|z3hA2m~ZIlt}*#Ojk8z*>COQ)vqI3qDbKhS A+W-In diff --git a/overlay/rootfs/usr/bin/sxmo_power.sh b/overlay/rootfs/usr/bin/sxmo_power.sh index a1a45f4..166df12 100755 --- a/overlay/rootfs/usr/bin/sxmo_power.sh +++ b/overlay/rootfs/usr/bin/sxmo_power.sh @@ -14,18 +14,29 @@ usage() { run_polkit_login1() { method="$1" python3 - "$method" <<'PYEOF' >/dev/null 2>&1 -import os, pty, sys +import os, pty, select, sys method = sys.argv[1] +if method == "Reboot": + acts = "org.freedesktop.login1.reboot org.freedesktop.login1.reboot-multiple-sessions org.freedesktop.login1.reboot-ignore-inhibit" +else: + acts = "org.freedesktop.login1.power-off org.freedesktop.login1.power-off-multiple-sessions org.freedesktop.login1.power-off-ignore-inhibit" cmd = ( "pkttyagent --process $$ & AG=$!; sleep 0.15; " - "dbus-send --system --print-reply --dest=org.freedesktop.login1 " - "/org/freedesktop/login1 org.freedesktop.login1.Manager." + method + " boolean:true; " - "RC=$?; kill $AG 2>/dev/null; exit $RC" + "for act in " + acts + "; do " + "pkcheck --action-id $act --process $$ -u >/dev/null 2>&1 || true; " + "done; " + "kill $AG 2>/dev/null || true; " + "exec busctl call --allow-interactive-authorization=true " + "org.freedesktop.login1 /org/freedesktop/login1 " + "org.freedesktop.login1.Manager " + method + " b true" ) pid, fd = pty.fork() if pid == 0: os.execlp("sh", "sh", "-c", cmd) while True: + r, _, _ = select.select([fd], [], [], 3.0) + if not r: + break try: d = os.read(fd, 1024) if not d: diff --git a/overlay/rootfs/usr/share/sxmo/appcfg/Xresources b/overlay/rootfs/usr/share/sxmo/appcfg/Xresources index 1c20b87..b15c5cb 100644 --- a/overlay/rootfs/usr/share/sxmo/appcfg/Xresources +++ b/overlay/rootfs/usr/share/sxmo/appcfg/Xresources @@ -15,7 +15,7 @@ dwm.selbgcolor: #005577 dwm.selbordercolor: #005577 dwm.selfgcolor: #ffffff -st.font: Fira Code:pixelsize=15:style=Regular:antialias=true:autohint=true +st.font: Fira Code:pixelsize=18:style=Regular:antialias=true:autohint=true st.background: #1c1c1c st.foreground: #e5e5e5 st.cursorColor: #cccccc diff --git a/prebuilt/sxmo-x11/usr/bin/st b/prebuilt/sxmo-x11/usr/bin/st index 83b666c538d9051309a7702b0f4bb78b698afd04..c2753951c11b201595c3575f77d3779cabe7846c 100755 GIT binary patch delta 42 zcmV+_0M-A5^aF(S1F%E^6kvmO_4KD4{zdPY0<8h-#q+OOU9(sL>COQ-vqI3qDa3FU AG5`Po delta 42 zcmV+_0M-A5^aF(S1F%E^6h2nf)N+J|z3hA2m~ZIlt}*#Ojk8z*>COQ)vqI3qDbKhS A+W-In diff --git a/src/sxmo-st/config.def.h b/src/sxmo-st/config.def.h index 300cd78..11df9d1 100644 --- a/src/sxmo-st/config.def.h +++ b/src/sxmo-st/config.def.h @@ -5,7 +5,7 @@ * * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html */ -static char *font = "Fira Code:pixelsize=15:style=Regular:antialias=true:autohint=true"; +static char *font = "Fira Code:pixelsize=18:style=Regular:antialias=true:autohint=true"; static int borderpx = 2; /* diff --git a/src/sxmo-st/config.h b/src/sxmo-st/config.h index 300cd78..11df9d1 100644 --- a/src/sxmo-st/config.h +++ b/src/sxmo-st/config.h @@ -5,7 +5,7 @@ * * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html */ -static char *font = "Fira Code:pixelsize=15:style=Regular:antialias=true:autohint=true"; +static char *font = "Fira Code:pixelsize=18:style=Regular:antialias=true:autohint=true"; static int borderpx = 2; /*