From 60f7aedd08927af27027e69f2aba5eefb9c8270c Mon Sep 17 00:00:00 2001 From: Luxferre Date: Sat, 24 Oct 2026 22:36:22 +0300 Subject: [PATCH] docs: rewrite feature overview and sync plugin reference in README and MANUAL --- MANUAL.md | 59 +++++++++-------------- README.md | 138 ++++++++++++++++++------------------------------------ 2 files changed, 66 insertions(+), 131 deletions(-) diff --git a/MANUAL.md b/MANUAL.md index 793776d..6ac3d59 100644 --- a/MANUAL.md +++ b/MANUAL.md @@ -10,50 +10,33 @@ This manual covers flashing, operating, and customizing **Bananarchy Linux** (Sx --- -## 1. What is prepared in this workspace +## 1. System overview & workspace contents ### 1.1 System images (`images/`) -- `images/bananarchy-nokia-argon.img` (linked as `images/nokia-argon-sxmo.img`) — raw partitioned image (`256 MiB` `ext2` `pmOS_boot` + `ext4` `pmOS_root`) ready for EDL flashing to `userdata` or raw `dd` to a microSD card. -- `images/bananarchy-nokia-argon.sparse.img` (linked as `images/nokia-argon-sxmo.sparse.img`) — Android sparse image for `fastboot flash userdata`. -- `images/boot-bananarchy-nokia-argon.img` (linked as `images/boot-nokia-argon-sxmo.img`) — standalone Android `boot.img` with Linux `6.12.1-msm8916`, initramfs, and appended DTB. +- `images/bananarchy-nokia-argon.img` — raw partitioned image (`256 MiB` `ext2` `pmOS_boot` + `ext4` `pmOS_root`) ready for EDL flashing to `userdata` or raw `dd` to a microSD card. +- `images/bananarchy-nokia-argon.sparse.img` — Android sparse image for `fastboot flash userdata`. +- `images/boot-bananarchy-nokia-argon.img` — standalone Android `boot.img` with Linux `6.12.1-msm8916`, initramfs, and appended DTB. - Additional device images (`bananarchy-nokia-beatles.img`, `bananarchy-nokia-tough.img`, `bananarchy-nokia-sparkler.img`) can be generated at any time via `./rebuild-image.sh --mkinitfs`. ### 1.2 Bootloader & EDL programmer (`bootloader/`) - `bootloader/lk2nd-msm8909.img` — secondary bootloader (`lk2nd`) providing Fastboot and `extlinux` boot discovery for MSM8905/MSM8909 devices. - `bootloader/loaders/8110.mbn` — signed Qualcomm Sahara/Firehose programmer (`05c6:9008`). -### 1.3 Integrated hardware & UX tweaks -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=18`, alongside full `XIM` (`fcitx5-t9`) input support. - - **Patched `sxmo-dmenu` plugin (`dmenu.so` / `dmenu` / `xdmenu`) (`< 2 ms` popup/close)**: preloaded resident DWM plugin rendering a full-screen `240x296` 10-line vertical menu (positioned flush at `Y = 24..320` right below the 24px `dwm` bar, with a `26px` search bar and ten `27px` item rows) 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`), built-in `< 0.5 ms` in-place Sxmo menu transitions (`Sys`, `Apps`, `Scripts`, `Modem`, `Config`, `Power`, `St`, `Nano`), and a `/tmp/dwm_plugin_dmenu.sock` IPC server for all `/usr/bin/dmenu` and `sxmo_dmenu.sh` calls. - - **Patched `sxmo-dwm` (`dwm`) (`< 2 ms` display wake/unlock & native plugin system)**: 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, and a transparent-backgrounded bottom desktop softkey bar displaying `"Menu"` and `"Names"` over the wallpaper). 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. - - **Preloaded DWM plugins (`src/sxmo-dmenu/`, `src/dwm-plugins/` & `src/xdrawer/`, `< 2 ms` FIFO/socket wakeup & unified `.Xresources` theming)**: `dwm` dynamically loads `.so` plugins from `/usr/lib/dwm/plugins/` and `~/.local/lib/dwm/plugins/` (`dmenu.so`, `xdrawer.so`, `dialer.so`, `calllog.so`, `callscreen.so`, `contacts.so`, `sms.so`, `files.so`, `camera.so`, `themes.so`, `modem.so`, `networks.so`) and preloads them as resident background daemons (`dwm-plugin --preload`) at startup. Each daemon keeps its X11 window, offscreen `Pixmap`, Xft/Pango layouts, and `stat()`-cached Sxmo TSV state initialized in memory while sleeping at 0% CPU on `/tmp/dwm_plugin_.fifo`. Every UI element across `dwm`, `dmenu`, `st`, and all C++ plugins obeys a single unified color and font scheme configured via `~/.Xresources` (`theme.*`, `dwm.*`, `dmenu.*`, `st.*`), with proportional font sizing derived from `theme.baseFontSize` (`12px` / `15px` / `16px` / `18px` at default `15`) and instant live reload via `xthemes`. -2. **Multi-mode `fcitx5-t9` keypad engine (`src/fcitx5-t9/`)**: - - Supports 6 input modes cycled with `#` (`XF86NumericPound`): `abc`, `Abc`, `ABC`, `Sym`, `Ctl`, and `123`, updating the live top-bar status indicator (`[abc]`, `[Abc]`, `[ABC]`, `[Sym]`, `[Ctl]`, `[123]`) in real time. - - Locks the candidate popup bar to the bottom of the screen (`X = 1, Y = 290, W = 238, H = 30`) with fixed-width 28-character monospace formatting (`Fira Code 9.5`), so neither the popup window nor individual letters ever jump when cycling through candidates. - - Includes instant case toggling during preedit, full 32-character ASCII punctuation/symbol entry, terminal control sequences (`^A`–`^Z`, `Esc`, `Tab`, `F1`–`F12`), and a `550ms` long-press `*` `Ctrl+` modifier latch. -3. **Bantam AI agent (`prebuilt/bantam/bantam`)**: - - Fetched from the latest `master` branch of `https://code.luxferre.top/luxferre/bantam-cpp`, cross-compiled for `armv7`, and installed to `/usr/bin/bantam` and `/usr/local/bin/bantam` (with no default `.bantam.cfg` pre-created). - - Integrated into the Sxmo **Apps** menu (`Applications -> Bantam`), launching in an `st` terminal with `$HOME` as its default working directory (`cd "$HOME" && sxmo_terminal.sh bantam`). -4. **Mainline 6.12.1-msm8916 QDSP6 audio (loudspeaker, earpiece, MEMS & headset mics), voice call & LTE modem stack**: - - Patched `q6core`, `q6afe`, `q6afe-dai`, `q6voice-dai`, `q6mvm`, and device trees (`VoiceMMode1` DAI + PM8909 WCD codec). - - Automatic PM8909 WCD analog codec register initialization at boot (`CDC_A_MICB_1_VAL` `0xf141 = 0x60` for 2.8V internal MEMS microphone bias, and `CDC_A_RX_EAR_CTL` `0xf1c0 |= 0x20` for +6 dB earpiece PA gain). - - WirePlumber `50-s16le.lua` (`S16LE` sample format enforcement), ALSA UCM2 profiles (`qdsp6.conf`, `HiFi.conf`, and `VoiceCall.conf`), `q6voiced` (`card=0, device=2`), `sxmo_audio.sh` / `sxmo_modemaudio.sh` PipeWire UCM profile switching, `sxmo_ob.sh` (`WOB_DISABLE_PLEDGE=1`), `rmtfs`, `msm-modem-uim-selection`, `msm8909-modem-wwan-port`, and `ModemManager` (`mmcli`). -5. **Rear 2MP camera (`src/msm8905-cam/`, `xcamera` & `bananarchy-photo`) & SY7807 torch LED (`src/leds-msm8905-torch/`)**: - - `msm8905-cam.ko`: powers PM8909 LDOs (`L2` 1.2V, `L6` 1.8V, `L17` 2.85V) and `CAMSS_MCLK0` (24 MHz on GPIO 26), configures the GalaxyCore `GC2395` MIPI CSI-2 sensor (`blsp_i2c3` `0x37`) and MSM8909 `CAMSS` (`CSIPHY0 -> CSID0 -> ISPIF -> VFE0 RDI0 -> VBIF -> CMA`), and exposes `/dev/video0` (`800x600` 24-bit `RGB3` V4L2 capture device). - - `xcamera` (`camera.so`): preloaded native DWM camera viewfinder and gallery plugin launched directly from **Camera** in the Sxmo System menu (`@plugin:camera`). - - `bananarchy-photo`: CLI and scriptable camera utility supporting instant JPEG/PNG photo capture, optional flash (`-f`), and `imv` photo viewing (`-v`). - - `leds-msm8905-torch.ko`: exposes `/sys/class/leds/white:torch` (`GPIO 31`), configures WCD micbias/earpiece registers at boot, and hooks PM8909 `PON` clean shutdown. -6. **Memory & swap tuning for 512 MB RAM**: - - `384 MiB` ZSTD-compressed `zram0` swap (priority `100`) + `512 MiB` `/swapfile` (priority `10`), with `vm.swappiness=100` and `vm.page-cluster=0`. -7. **Preinstalled on-device development & scripting stack**: - - **C / C++ toolchain & CLI utilities**: `gcc`, `g++`, `musl-dev`, `make`, `git`, GNU `coreutils`, `nano` (default `$EDITOR`, configured system-wide via `/etc/nanorc` equivalent to `nano -FEDSMAGic/max%_T2`), `ed`, GNU `less` (default `$PAGER="less -RXF"`), `rlwrap`, `frotz` (Z-machine interactive fiction interpreter) - - **Janet**: `janet`, `janet-dev`, `jpm` (Janet package manager) - - **Perl**: `perl`, `perl-io-socket-ssl` (`IO::Socket::SSL`) - - **Tcl & SQLite**: `tcl`, `tcl-lib` (`tcllib`), `tcl-tls`, `sqlite` (`sqlite3`), `sqlite-tcl` (`tcl-sqlite`) - - **Hardware & media utilities**: `bananarchy-photo`, `v4l-utils` (`v4l2-ctl`), `i2c-tools`, `ffmpeg`, `mpv`, `imv` +### 1.3 Core architecture highlights +1. **Pure X11 (`Xlibre` + `sxmo-de-dwm`) for `240x320` QVGA displays**: + - Uses a lightweight cross-compiled **Xlibre** server with `modesetting` KMS + partial-rectangle `ShadowFB` SPI updates and zero Wayland overhead. + - **Patched `dwm`** provides a `240x320` vertical bottom-stack (`bstack`) layout, a 24px top status bar, a transparent `"Menu"` / `"Names"` desktop softkey bar, and direct `< 2 ms` C-level handling of physical slider (`SW_LID`) and wake keys. +2. **Preloaded resident DWM plugins (`< 2 ms` wakeup)**: + - Core phone applications (`dmenu`, `xdrawer`, `dialer`, `calllog`, `callscreen`, `contacts`, `sms`, `files`, `camera`, `themes`, `modem`, `networks`, `ringtones`, `wallpapers`) run as preloaded resident daemons (`dwm-plugin --preload`) that sleep at 0% CPU and open instantaneously over FIFO/socket IPC. + - All UI elements share a single **XRDB theming engine** (`~/.xthemes/*.xth` -> `~/.Xresources`) with 20 preinstalled color schemes, proportional font sizing (`theme.baseFontSize`), and live reload without restarting X11. +3. **First-class terminal (`st`) & 6-mode `fcitx5-t9` keypad input**: + - `st` is patched with HarfBuzz OpenType ligature shaping (`Fira Code` default) and live `.Xresources` reload. + - `fcitx5-t9` provides 6 keypad input modes (`abc`, `Abc`, `ABC`, `Sym`, `Ctl`, `123` + `*` long-press `Ctrl+` latch) in a fixed bottom candidate bar (`Y = 290, H = 30`). +4. **Mainline Linux 6.12 hardware drivers**: + - **QDSP6 / Q6Voice audio & Dual-SIM modem**: Loudspeaker, boosted (+6 dB) earpiece, internal MEMS and headset microphones, `ModemManager` + `q6voiced` call audio routing, and Dual-SIM UIM slot switching (`msm-modem-uim-selection`). + - **Rear 2MP camera & torch LED**: `msm8905-cam` V4L2 driver (`/dev/video0` `800x600` `RGB3` for GalaxyCore `GC2395`) and `leds-msm8905-torch` (`white:torch` + PM8909 clean poweroff). +5. **Preinstalled developer & utility stack**: + - `gcc`/`g++`, `make`, `git`, GNU `coreutils`, `nano`, `ed`, `less`, `rlwrap`, `janet` + `jpm`, `bantam` coding agent, `perl` (`IO::Socket::SSL`), `tcl` (`tcllib`, `tcl-tls`, `sqlite-tcl`), `sqlite3`, `frotz`, `ffmpeg`, `mpv`, `imv`, and standalone `snake` and `tetris` X11 games. --- @@ -225,13 +208,13 @@ All fourteen core phone overlays are compiled as shared-object plugins (`/usr/li - **`3:Bluetooth`**: Toggle Bluetooth controller power (`doas rfkill unblock bluetooth` + `bluetoothctl power on/off`), scan for nearby devices (`*` or **Scan Nearby (`8s`)**), and manage paired/discovered devices (**Connect**, **Disconnect**, **Pair & Trust**, **Forget / Remove**). 13. **`Ringtones & Ringer Manager` (`ringtones.so` / `xringtones`) — Ringtone Browser, Live Preview & Ringer Settings**: - - **Open**: Select **Ringtones** from the **Config**, **Audio**, or **Apps** menu, or run `xringtones`. + - **Open**: Select **Ringtones** from the **System**, **Config**, **Audio**, or **Apps** menu, or run `xringtones`. - **Tabs (`Left`/`Right` or `1` / `2`)**: - **`1:Ringtones`**: Lists built-in synthesized ringtones (`/usr/share/sxmo/ringtones/*.wav` and `/usr/share/sxmo/ring.ogg`) alongside user audio files in `~/Ringtones/` and `~/Music/`. Press **`*`** or **Left softkey (`Play` / `Stop`)** to preview any ringtone live via `mpv`, and press **`Return` (`Set Ring`)** to save it as the active incoming call ringtone (`~/.config/sxmo/ringtone`). - **`2:Settings`**: Adjust **Ringer Mode** (`Ring + Vibrate`, `Ring Only`, `Vibrate Only`, `Silent`), **Ring Duration** (`10s`–`60s`), **Ring Loop Count** (`3x`–`50x`), **Vibrate Strength** (`Level 1`–`3`), and **Test Vibration** (`~/.config/sxmo/ringsettings`). 14. **`Desktop Wallpaper Manager` (`wallpapers.so` / `xwallpapers` / `xbackground`) — Live Preview & Wallpaper Selector**: - - **Open**: Select **Wallpapers** from the **Config** or **Apps** menu, or run `xwallpapers` / `xbackground`. + - **Open**: Select **Wallpapers** from the **System**, **Config**, or **Apps** menu, or run `xwallpapers` / `xbackground`. - **Controls**: Browses system wallpapers (`/usr/share/wallpapers/`) and user photos (`~/Pictures/Wallpapers/` and `~/Pictures/`) with a live decoded portrait thumbnail, image resolution, and file size. Press **`Left` / `Right`** (or `#`) to cycle the scaling mode (`Fill (Crop)`, `Scale (Stretch)`, `Fit (Max)`, `Center (1:1)`, `Tile`), press **`*`** or **Left softkey (`View [*]`)** to toggle a full-screen preview, and press **`Return` (`Apply`)** to apply the wallpaper immediately via `feh` and persist it in `~/.config/sxmo/wallpaper`. #### 3.1.3 Standalone Keypad Games (`Snake` & `Tetris`) diff --git a/README.md b/README.md index 242acaf..85e9421 100644 --- a/README.md +++ b/README.md @@ -6,32 +6,30 @@ 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), 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` with native C/C++ plugin architecture**: `240x320` vertical `bstack` layout, 24px Pango status bar with an overflow-protected right-aligned clock, transparent-backgrounded `"Menu"` and `"Names"` desktop softkey labels, direct C `SW_LID` slider and locked-key wake handling in `< 2 ms`, and a dynamic `.so` plugin API (`dwm_plugin.h`) with preloaded resident daemons (`--preload`) and non-blocking FIFO IPC (`< 10 ms` wakeup latency). -- **Preloaded `240x320` keypad-driven DWM plugins (`dmenu`, `xdrawer`, `dialer`, `calllog`, `callscreen`, `contacts`, `sms`, `files`, `camera`, `themes`, `modem`, `networks`)**: - - **`DMenu` (`dmenu.so` / `dmenu` / `xdmenu`)**: zero-lag (`< 2 ms` popup/close) resident `240x320` full-screen 10-line vertical menu (`240x296` flush below the 24px top bar) with a `#383838` search bar, `#005577` prompt badge, `XIM` `fcitx5-t9` text input, in-place `< 0.5 ms` native Sxmo submenu transitions (`Sys`, `Apps`, `Scripts`, `Modem`, `Config`, `Power`, `Audio`, `Notifications`, `WM`, `Timezone`, `Games`, `St`, `Nano`), and a `/tmp/dwm_plugin_dmenu.sock` client interface serving all `/usr/bin/dmenu` and `sxmo_dmenu.sh` pipes instantaneously. - - **`XDrawer` (`xdrawer.so` / `xdrawer`)**: global phone controls overlay invoked from anywhere by pressing **both softkeys simultaneously**, providing instant sliders and toggles for speaker volume, earpiece volume, ringer mode (`Ring+Vib` / `Vibrate` / `Silent` / `DND`), flashlight, sound mute, microphone mute, screen brightness, and keypad backlight. - - **`Dialer` (`dialer.so` / `xdialer`)**: opens automatically from the idle desktop when pressing any **`0`–`9`, `*`, or `#` key** (inserting that character immediately), with live T9/number contact filtering, hold-`0` for `+`, single-press **Call** dialing, direct USSD code execution (`*100#`, etc.) with interactive session reply modal, and instant **`*#06#`** Dual-SIM IMEI (`IMEI 1` & `IMEI 2`) display. - - **`Call Log` (`calllog.so` / `xcalllog`)**: opens automatically from the idle desktop when pressing the **Call (green)** button, with `All` / `Missed` / `In` / `Out` tabs, contact resolution, call durations, and instant redial. - - **`Call Screen` (`callscreen.so` / `xcallscreen`)**: dedicated incoming, outgoing, and in-call screen integrated with Sxmo's `ModemManager` call lifecycle (`sxmo_modem.sh`, `sxmo_modemcall.sh`, `sxmo_modemdial.sh`), displaying resolved caller name and phone number, accepting/rejecting incoming calls via physical **Call (green)** and **End (red)** buttons (plus `*`/`0` ringtone silence), live `MM:SS` call timer, microphone mute/unmute (`1`/`*`), live call recording to `~/Recordings/call__.wav` (`2`/`#`), earpiece/speaker audio routing (`3`), volume control (`Left`/`Right`), and DTMF tone keypad mode (`0` / `Left softkey`). - - **`Contacts` (`contacts.so` / `xcontacts`)**: full-featured phonebook application opened from the idle desktop via the **Right softkey (`Names`)** or from the Sxmo menu, integrated with `~/.config/sxmo/contacts.tsv` (live T9/number search, call/SMS/dialer actions, built-in contact editor with keypad multi-tap name entry and recent-caller number picker, and contact deletion). - - **`SMS Manager` (`sms.so` / `xsms`)**: conversation thread manager, bubble message history reader, and multi-tap keypad SMS composer/draft editor (with dynamic `Send` / `Draft` center softkey action) integrated with `$SXMO_LOGDIR//sms.txt`, `draft.txt`, `modemlog.tsv`, and `sxmo_modemsendsms.sh`. - - **`File Manager` (`files.so` / `xfiles`)**: graphical directory browser with live T9/number filtering, dotfiles toggle (`*`), sort mode cycle (`#`), file operations (new folder/file, rename, copy, cut/move, paste, delete, properties, edit in `nano`, open terminal here), built-in text viewer, and built-in `libjpeg`/`libpng` image previewer. - - **`Camera` (`camera.so` / `xcamera`)**: live V4L2 `/dev/video0` (`800x600` `RGB24` -> `240x180` 4:3) viewfinder with 1-second frame watchdog, auto-flash (`*`/`1`), continuous torch (`0`/`2`), digital zoom (`1x`/`2x`/`4x` via `Up`/`Down`), 3-second self-timer (`#`/`3`), direct `libjpeg` photo capture to `~/Pictures/photo-YYYYMMDD-HHMMSS.jpg`, and built-in photo gallery. - - **`Modem, Dual-SIM & PIN/PUK Manager` (`modem.so` / `xmodem`)**: 3-tab (`1:SIMs`, `2:Radio`, `3:Log`) cellular and Dual-SIM manager inspecting both physical Qualcomm UIM slots (`qmicli -pd qrtr://0 --uim-get-card-status` + `mmcli`), supporting active SIM slot switching (`primary-gw-provisioning` between Slot 1 and Slot 2 persisted in `/etc/conf.d/msm-modem-uim-selection`), masked keypad SIM PIN unlock (`4`–`8` digits), 3-step PUK unblock wizard (`8`-digit PUK + new PIN + confirm), PIN lock enable/disable and PIN change, 2G/3G/4G radio mode switching, interactive USSD session dialog (`*100#`, etc.), and color-coded modem event log viewer. - - **`Networks & Bluetooth Manager` (`networks.so` / `xnetworks` / `xbluetooth`)**: 3-tab (`1:Wi-Fi`, `2:Cell/APN`, `3:Bluetooth`) connectivity manager providing Wi-Fi radio toggle, visual signal bars, multi-tap Wi-Fi WPA/WPA2 password dialog (`*` show/hide password), Wi-Fi Hotspot and USB Tethering toggles, cellular data (`sxmo_modemdata.sh`) and inline APN editor (`Name`, `Username`, `Password`), and Bluetooth controller power, scanning, pairing, and audio/device connection management. - - **`Theme Manager` (`themes.so` / `xthemes`)**: unified `.Xresources` theme browser and live customizer managing `~/.xthemes/*.xth` (where every `.xth` file is a valid `Xresources` file controlling `theme.*`, `dwm.*`, `dmenu.*`, `st.*`, and `svkbd.*` colors, font face, and `baseFontSize` with proportional derived font sizes, pre-populated with 20 themes: `Default.xth`, `BananaGold.xth`, `CatppuccinLatte.xth`, `CatppuccinMocha.xth`, `Cyberpunk.xth`, `Dracula.xth`, `EverforestDark.xth`, `GitHubDark.xth`, `GruvboxDark.xth`, `GruvboxLight.xth`, `Kanagawa.xth`, `LinuxConsole.xth`, `MatrixGreen.xth`, `MonokaiPro.xth`, `NordFrost.xth`, `OneDark.xth`, `RosePine.xth`, `SolarizedDark.xth`, `SolarizedLight.xth`, and `TokyoNight.xth`). Applying or editing a theme reloads `dwm`, `dmenu`, `st`, and all resident DWM plugins live without restarting X11. -- **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`, native `xcamera` DWM plugin, and the `bananarchy-photo` CLI utility. -- **Pre-integrated Bantam AI agent**: cross-compiled from `https://code.luxferre.top/luxferre/bantam-cpp` and integrated into the Sxmo **Apps** menu (`Applications -> Bantam`, launching in an `st` terminal with `$HOME` as its default working directory). -- **Built-in keypad X11 games (`Snake` & `Tetris`)**: standalone zero-dependency X11 games (`src/games/snake.cpp`, `src/games/tetris.cpp`) integrated into the Sxmo **Games** menu (`System Menu -> Games`), featuring Nokia green / Gameboy beveled aesthetics, batched `XFillRectangles` rendering, and `timerfd`-driven pacing. -- **Complete on-device development & scripting stack**: `git`, `gcc`/`g++`, `make`, GNU `coreutils`, `nano` (`$EDITOR`, pre-configured in `/etc/nanorc` with `-FEDSMAGic/max%_T2`), `ed`, `less` (`$PAGER="less -RXF"`), `rlwrap`, `frotz` (Z-machine interactive fiction interpreter), `janet` + `jpm`, `perl` + `IO::Socket::SSL`, `tcl` + `tcllib`/`tcl-tls`/`sqlite-tcl`, `sqlite`, `i2c-tools`, and `v4l-utils`. +## Key features + +### System & hardware support +- **Mainline Linux 6.12 kernel**: Custom patches and out-of-tree kernel drivers for Qualcomm QDSP6/Q6Voice audio routing, Dual-SIM modem control, the rear 2MP GalaxyCore `GC2395` camera (`/dev/video0`), `SY7807` torch LED (`white:torch`), and physical keypad/slider events. +- **Alpine Linux Edge base**: Full access to the Alpine package ecosystem with `< 95 MB` idle RAM usage on 512 MB devices. +- **Pure X11 graphical stack**: Cross-compiled **Xlibre** (`X11Libre/xserver`) display server paired with a heavily optimized **Sxmo (`sxmo-de-dwm`)** window manager (`240x320` vertical stack layout, `< 2 ms` slider/key wake latency, and zero Wayland overhead). + +### Keypad-first user experience & native DWM plugins +Instead of spawning slow shell scripts for everyday phone tasks, Bananarchy runs a suite of preloaded resident C/C++ plugins inside DWM that open in `< 2 ms`: +- **System & context menus (`dmenu`)**: Instant full-screen 10-line vertical menus with live T9 filtering and built-in submenus. +- **Global controls drawer (`xdrawer`)**: Press **both softkeys together** from anywhere to adjust speaker/earpiece volume, ringer mode, flashlight, mic/sound mute, screen brightness, and keypad backlight. +- **Phone dialer (`xdialer`), call log (`xcalllog`) & call screen (`xcallscreen`)**: Press any digit on the home screen to start dialing with live T9 contact matching, run carrier USSD codes (`*100#`, etc.) interactively, or type `*#06#` to inspect both IMEIs. Incoming and active calls open a dedicated call screen with earpiece/speaker routing, microphone mute, DTMF keypad, and one-key call recording (`~/Recordings/`). +- **Contacts (`xcontacts`) & SMS manager (`xsms`)**: Full phonebook editor and threaded conversation/draft SMS manager with multi-tap keypad text entry. +- **Modem & Dual-SIM manager (`xmodem`)**: 4-tab cellular control center (`1:SIMs`, `2:Radio`, `3:AT`, `4:Log`) supporting physical SIM 1 / SIM 2 active slot switching, SIM PIN unlock and PUK unblock wizards, 2G/3G/4G mode selection, interactive USSD sessions, and a live AT command console. +- **Networks & Bluetooth manager (`xnetworks`)**: 3-tab connectivity manager (`1:Wi-Fi`, `2:Cell/APN`, `3:Bluetooth`) for Wi-Fi networks, WPA2 password entry, hotspot/USB tethering, mobile data & APN editing, and Bluetooth pairing. +- **File manager (`xfiles`) & camera (`xcamera`)**: Graphical directory browser with built-in text and image viewers, plus a live V4L2 camera viewfinder with digital zoom, flash/torch control, self-timer, and photo gallery. +- **Themes (`xthemes`), wallpapers (`xwallpapers`) & ringtones (`xringtones`)**: Installable `.Xresources` color/font themes (`~/.xthemes/*.xth`, 20 preinstalled schemes) with live zero-restart reload across the entire UI and terminal, alongside dedicated managers for desktop wallpapers and call ringtones/vibration. + +### Input, terminal & developer tools +- **6-mode `fcitx5-t9` keypad input**: Cycle with `#` between `abc`, `Abc`, `ABC`, `Sym` (all 32 ASCII punctuation symbols), `Ctl` (`Ctrl` sequences, arrows, `PageUp`/`PageDown`, `F1`–`F12`), and `123` numeric modes with a fixed bottom candidate bar. +- **First-class Linux terminal (`st`)**: Patched with HarfBuzz OpenType ligatures (`Fira Code` as the default system and terminal font), XIM T9 input, and live theme reloading. +- **On-device development & AI**: Preinstalled `gcc`/`g++`, `make`, `git`, GNU `coreutils`, `nano`, `ed`, `sqlite`, `perl`, `tcl`, the [Janet](https://janet-lang.org/) language & `jpm`, the [Bantam](https://bantam.luxferre.top/) coding agent, `frotz` (interactive fiction), and standalone X11 keypad games (`Snake` and `Tetris`). --- @@ -51,82 +49,33 @@ Bananarchy targets an ultra-lightweight **Sxmo X11 (`sxmo-de-dwm`)** environment ```text bananarchy/ -├── README.md # Project architecture, build system, and quickstart guide +├── README.md # Project overview, repository layout, and build workflow ├── MANIFESTO.md # The Bananarchy Manifesto -├── MANUAL.md # Complete flashing, keypad, T9, camera, audio, Bantam, and modem manual +├── MANUAL.md # Complete flashing, keypad, plugin, T9, camera, and modem manual ├── flash-edl.sh # Automated USB EDL flasher wrapper (sudo + ModemManager handling) ├── flash-edl.py # Multi-device Qualcomm Sahara/Firehose EDL flasher ├── rebuild-image.sh # Builds boot.img, MBR raw .img, and Android .sparse.img ├── chroot-shell.sh # Rootless Docker armv7 package & rootfs customization shell ├── artwork/ # Bananarchy master icon, generated icons, wallpapers, and splashes -│ ├── icon-large.png # Master 1024x1024 Bananarchy emblem -│ ├── icon-{512..16}.png # Downsampled RGB square icons -│ ├── icon-transparent-{512..32}.png # Alpha-keyed RGBA icons for UI themes -│ ├── favicon.ico # Multi-resolution ICO -│ ├── wallpaper-240x320.png / .jpg # Default Sxmo 240x320 portrait wallpaper -│ ├── wallpaper-240x320-centered.png/.jpg# Centered 240x320 portrait wallpaper -│ ├── wallpaper-320x240.png / .jpg # Landscape 320x240 QVGA wallpaper -│ ├── wallpaper-240x240.png # Square 240x240 wallpaper (Nokia 2720 Flip external display) -│ ├── splash-240x320.png / .ppm # 240x320 boot splash image -│ └── banner-800x240.png # Project header banner -├── bootloader/ -│ ├── lk2nd-msm8909.img # lk2nd secondary bootloader for MSM8905/MSM8909 -│ └── loaders/ -│ └── 8110.mbn # Qualcomm Sahara/Firehose programmer (05c6:9008) +├── bootloader/ # lk2nd secondary bootloader and Sahara/Firehose programmer (8110.mbn) ├── devices/ # Device definitions, DTBs, and MIPI-DBI panel init sequences -│ ├── common-msm8909/ # Shared udev keypad rules, WirePlumber S16LE, ALSA UCM2, zram -│ ├── nokia-argon/ # Nokia 8110 4G device package, DTS/DTB, and GC9305 panel init -│ ├── nokia-beatles/ # Nokia 2720 Flip device package, DTS/DTB, and GC9305 panel init -│ ├── nokia-tough/ # Nokia 800 Tough device package, DTS/DTB, and GC9305 panel init -│ └── nokia-sparkler/ # Nokia 8000 4G & 6300 4G device package, DTS/DTB, and GC9307/9305 init -├── patches/ -│ ├── kernel/ -│ │ ├── 0001-msm8909-qdsp6-voice-sound-nokia-argon-6.12.patch -│ │ ├── 0002-msm8905-nokia-beatles-and-coconut-dts.patch -│ │ └── config-bananarchy-msm8909.armv7 -│ ├── edl/ -│ │ └── 0001-edl-msm8909-32bit-elf-and-multi-cmd-firehose.patch -│ ├── sxmo/ -│ │ └── 0001-bananarchy-sxmo-240x320-keypad-ui.patch -│ ├── xlibre/ -│ │ ├── 0001-xlibre-msm8905-spi-drm-and-shared-vt.patch -│ │ ├── 0002-xf86-input-libinput-xlibre25.patch -│ │ └── 0003-xf86-video-fbdev-xlibre25.patch -│ └── fcitx5-t9/ -│ └── 0001-bananarchy-multimode-t9-and-fcitx5-5.1.19.patch +├── patches/ # Upstream kernel, EDL, Sxmo, Xlibre, and fcitx5-t9 patch sets ├── src/ -│ ├── sxmo-dwm/ # Patched sxmo-dwm (240x320 bstack, Pango bar, desktop softkey bar & plugin API) -│ ├── dwm-plugins/ # DWM plugins (dialer, calllog, callscreen, contacts, sms, files, camera, themes, modem, networks, ringtones, wallpapers), theme.h & runner +│ ├── sxmo-dwm/ # Patched sxmo-dwm (240x320 bstack, Pango bar, softkey bar & plugin API) +│ ├── dwm-plugins/ # DWM plugins (dialer, calllog, callscreen, contacts, sms, files, camera, +│ │ # themes, modem, networks, ringtones, wallpapers), theme.h & runner │ ├── xdrawer/ # XDrawer global phone controls DWM plugin (xdrawer.so / xdrawer) -│ ├── sxmo-dmenu/ # Patched sxmo-dmenu zero-lag DWM plugin (dmenu.so) & client/fallback (dmenu / xdmenu) -│ ├── sxmo-st/ # Patched sxmo-st terminal with HarfBuzz Fira Code ligature shaping & XIM -│ ├── xf86-input-libinput/ # X11Libre xf86-input-libinput DDX driver -│ ├── xf86-video-fbdev/ # X11Libre xf86-video-fbdev fallback DDX driver -│ ├── fcitx5-t9/ # C++20 source of Bananarchy's 6-mode fcitx5-t9 input method +│ ├── sxmo-dmenu/ # Resident DWM menu plugin (dmenu.so) & client (dmenu / xdmenu) +│ ├── sxmo-st/ # Patched sxmo-st terminal with HarfBuzz Fira Code ligatures & XIM +│ ├── xf86-input-libinput/ # Xlibre xf86-input-libinput DDX driver +│ ├── xf86-video-fbdev/ # Xlibre xf86-video-fbdev fallback DDX driver +│ ├── fcitx5-t9/ # 6-mode fcitx5-t9 keypad input method │ ├── games/ # Standalone keypad X11 games (snake.cpp, tetris.cpp) -│ ├── leds-msm8905-torch/ # Kernel driver for SY7807 rear torch LED, WCD codec init & PM8909 PON shutdown -│ └── msm8905-cam/ # Kernel V4L2 driver for GC2395 2MP rear camera & MSM8909 CAMSS (/dev/video0) -├── overlay/ -│ └── rootfs/ # Complete Bananarchy rootfs overlay (OS branding, Sxmo X11, audio, camera, T9, .xthemes) -├── prebuilt/ -│ ├── xlibre/ # Prebuilt armv7 Xlibre Xorg binary and modesetting/libinput/fbdev DDX modules -│ ├── sxmo-x11/ # Prebuilt armv7 patched dwm, dmenu.so/dmenu, 13 C++ DWM plugins, and st (HarfBuzz ligatures) -│ ├── games/ # Prebuilt armv7 standalone X11 games (snake, tetris) -│ ├── kernel-6.12.1-msm8916/ # Prebuilt QDSP6/Q6Voice .ko, torch .ko, camera .ko, and 5 device DTBs -│ ├── fcitx5-t9/ # Prebuilt armv7 libt9.so and fcitx5 addon/inputmethod configs -│ └── bantam/ # Prebuilt armv7 bantam AI agent binary -└── scripts/ - ├── generate-artwork.py # Generates all wallpapers, icons, and splashes from icon-large.png - ├── mipi-dbi-cmd.py # Compiles MIPI-DBI panel .txt init sequences into .bin firmware - ├── build-xlibre.sh # Cross-compiles Xlibre + xf86-input-libinput + xf86-video-fbdev for armv7 Cortex-A7 - ├── build-sxmo-x11.sh # Cross-compiles sxmo-st (HarfBuzz), sxmo-dmenu (dmenu.so + dmenu), sxmo-dwm & DWM plugins - ├── build-dmenu.sh # Cross-compiles sxmo-dmenu (dmenu.so + stest) standalone - ├── build-games.sh # Cross-compiles standalone X11 games (snake, tetris) for armv7 - ├── build-kernel-audio.sh # Cross-compiles Linux 6.12.1-msm8916 QDSP6/torch/camera modules & DTBs - ├── build-fcitx5-t9.sh # Cross-compiles src/fcitx5-t9 for armv7 - ├── build-bantam.sh # Fetches master from https://code.luxferre.top/luxferre/bantam-cpp & cross-compiles for armv7 - ├── apply-bananarchy-overlay.sh # Applies overlay, prebuilts, artwork, and device DTB to rootfs - └── configure-rootfs-from-scratch.sh # Full rootfs configuration script from base Alpine/pmOS packages +│ ├── leds-msm8905-torch/ # Kernel driver for SY7807 torch LED, WCD codec init & PON shutdown +│ └── msm8905-cam/ # Kernel V4L2 driver for GC2395 2MP rear camera (/dev/video0) +├── overlay/rootfs/ # System configuration overlay applied over the target rootfs +├── prebuilt/ # Pre-compiled armv7 binaries and kernel modules +└── scripts/ # Cross-compilation, artwork generation, and overlay scripts ``` --- @@ -145,10 +94,13 @@ All components are pre-compiled in `prebuilt/` and `overlay/rootfs/`, and can be # Rebuild cross-compiled Xlibre (X11Libre/xserver) + libinput/fbdev DDX drivers ./scripts/build-xlibre.sh -# Rebuild patched sxmo-st (HarfBuzz Fira Code ligatures), sxmo-dmenu (dmenu.so + dmenu), sxmo-dwm & all 8 DWM plugins +# Rebuild patched sxmo-st, sxmo-dmenu, sxmo-dwm & all 13 C++ DWM plugins ./scripts/build-sxmo-x11.sh -# Rebuild multi-mode fcitx5-t9 input engine (src/fcitx5-t9 -> prebuilt/fcitx5-t9) +# Rebuild standalone X11 games (snake, tetris) +./scripts/build-games.sh + +# Rebuild multi-mode fcitx5-t9 input engine ./scripts/build-fcitx5-t9.sh # Fetch latest master from https://code.luxferre.top/luxferre/bantam-cpp and cross-compile Bantam AI agent