# Bananarchy Linux — user, flashing, and customization manual ![Bananarchy Banner](artwork/banner-800x240.png) This manual covers flashing, operating, and customizing **Bananarchy Linux** (`240x320` native edition) on **Qualcomm MSM8905 and MSM8909** Nokia feature phones. Current release: `a1120` (codename `cocojamboo`); see the [changelog](./CHANGELOG.md) for release notes. - **Nokia 8110 4G (`nokia-argon`)** — verified public release: https://bananarchy.top/builds/bananarchy-nokia-argon-a1120-cocojamboo.zip - **Nokia 2720 Flip (`nokia-beatles`)** — verified public release: https://bananarchy.top/builds/bananarchy-nokia-beatles-a1120-cocojamboo.zip - **Nokia 800 Tough (`nokia-coconut`)** — verified public release: https://bananarchy.top/builds/bananarchy-nokia-coconut-a1120-cocojamboo.zip - **Nokia 8000 4G (`nokia-sparkler`)** — verified public release: https://bananarchy.top/builds/bananarchy-nokia-sparkler-a1120-cocojamboo.zip - **Nokia 6300 4G (`nokia-leo`)** — sibling source build via `./rebuild-image.sh nokia-leo` --- ## 1. System overview and workspace contents ### 1.1 System images (`images/`) - `images/bananarchy-nokia-argon.img`, `images/bananarchy-nokia-beatles.img`, `images/bananarchy-nokia-coconut.img`, and `images/bananarchy-nokia-sparkler.img`: partitioned MBR images (`256 MiB` `ext2` `pmOS_boot` + `ext4` `pmOS_root`) ready for EDL flashing to `userdata`, `fastboot flash userdata`, or raw `dd` to a microSD card. - `images/boot-lk2nd-nokia-beatles-display.img` and `images/boot-bananarchy-nokia-beatles.img`: the 2720 Flip display-enabled `lk2nd` secondary bootloader (`boot`) and standalone mainline Android `boot.img` (`recovery`). Equivalent builds for `nokia-coconut` and `nokia-sparkler` are written to `images/boot-lk2nd-nokia--display.img` and `images/boot-bananarchy-nokia-.img`. - If you downloaded a public release `.zip` archive (`bananarchy--a1120-cocojamboo.zip` for `nokia-argon`, `nokia-beatles`, `nokia-coconut`, or `nokia-sparkler`), extract its `.img` files into `images/` before running `./flash-edl.sh `. Any target image (including sibling `bananarchy-nokia-leo.img`) can also be rebuilt from source at any time via `./rebuild-image.sh --mkinitfs`. ### 1.2 Bootloader and EDL programmer (`bootloader/`) - `bootloader/lk2nd-msm8909.img`: secondary bootloader (`lk2nd`) providing Fastboot and `extlinux` boot discovery for MSM8905 and MSM8909 devices. `images/boot-lk2nd-nokia-beatles-display.img`, `images/boot-lk2nd-nokia-coconut-display.img`, and `images/boot-lk2nd-nokia-sparkler-display.img` are the source-built 2720 Flip, 800 Tough, and 8000 4G ports (see `bootloader/lk2nd/README.md`). - `bootloader/loaders/`: signed Qualcomm Sahara/Firehose programmers (`05c6:9008`), one per target. The flasher picks the right one from `--device` / the positional target; run `./flash-edl.sh --list-loaders` to see each file's embedded attestation identity and mapping. Pass `--variant us` for a 2720 Flip US variant or `--loader PATH` to override the programmer entirely. ### 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, a native `ParentRelative` desktop datetime overlay (`Fira Code` 32pt `%H:%M` and 14pt `%a %d %b %Y` with 1px drop shadow, rendered directly by `dwm` with zero external Conky process overhead and automatic live timezone/wallpaper refresh), and `< 2 ms` handling of physical slider (`SW_LID`) and wake keys. The status bar clock is refreshed synchronously on unlock, whenever dmenu updates its input-method indicator, and every minute by a lightweight aligned job (the heavier status bar periodics stay at 300 s). Its status file is kept current even while the panel is blanked, so it cannot keep showing a pre-lock time after the panel wakes. Network state changes are handled by the NetworkManager dispatcher instead of a long-lived `nmcli device monitor`, so connectivity stays immediate without an idle poller. 2. **Preloaded resident DWM plugins (`< 2 ms` wakeup)**: - Core phone applications (`dmenu`, `xdrawer`, `dialer`, `calllog`, `callscreen`, `contacts`, `sms`, `files`, `camera`, `themes`, `passcode`, `modem`, `networks`, `ringtones`, `wallpapers`, `music`, `sip`, `email`, `irc`, `tox`, `smallweb`, `webarchy`, `gps`, `privacy`, `engmenu`, `locker`) run as preloaded resident daemons (`dwm-plugin --preload`) that sleep at 0% CPU and open instantaneously over FIFO/socket IPC. - All UI elements — including the `dunst` notification daemon (`bananarchy-sync-dunst-theme`) — share the **NeoUI SDK (`libneoui.so` + `/usr/include/neoui.h`)** and a single **XRDB theming engine** (`~/.xthemes/*.xth` -> `~/.Xresources`) with 21 preinstalled color schemes, proportional font sizing (`theme.baseFontSize`), and live reload without restarting X11. NeoUI exposes both C++20 classes and a C-compatible FFI (`neoui_*`) for building custom native or scripted (`yabasic` via `~/Projects/neoui.yab`, `~/Projects/neoui_demo.yab`, and `~/Projects/bulls_cows.yab`, paired with **NeoNet** in `~/Projects/neonet.yab` and `~/Projects/neonet_demo.yab` for `libcurl` HTTP/HTTPS and TCP/TLS/UDP socket networking) `240x320` GUI applications — see [SDK.md](./SDK.md) for the complete API reference and examples. 3. **First-class terminal (`st`) and 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 and Dual-SIM modem**: loudspeaker, boosted (+6 dB) earpiece, internal MEMS and headset microphones, `ModemManager` + `q6voiced` call audio routing, and direct Qualcomm QMI UIM Dual-SIM Dual Standby (DSDS), instant default SIM switching, Primary/Secondary GW (`4G/Data`) slot swapping, PIN/PUK management, and SIM phonebook access. - **Rear 2MP camera and torch LED**: `msm8905-cam` V4L2 driver (`/dev/video0` `800x600` `RGB3` for GalaxyCore `GC2395` / `GC2385` / `GC2365`) and `leds-msm8905-torch` (`white:torch` + PM8909 clean poweroff). 5. **Preinstalled developer and utility stack**: - `curl`, `git`, GNU `coreutils`, GNU `bc`/`dc`, `nano`, `ed`, `less`, `rlwrap`, `mandoc`, `yabasic` (with the `neoui.yab` / `neonet.yab` FFI wrappers), `bantam` coding agent, `tcl` (runtime for `expect`), `frotz`, `ffmpeg`, `mpv`, `imv`, standalone `snake`, `tetris`, and `scoundrel` X11 games, the `gambatte` Game Boy / Game Boy Color emulator, and the **ReMEdy (`remedy` / `j2me`)** `240x320` J2ME (MIDP 2.0 / CLDC 1.1) emulator. No on-device compiler, Janet, Perl, Lua, or `sqlite3` CLI is shipped; native code is cross-compiled with `scripts/build-*.sh`. `curl`, `bc`, `ed`, `rlwrap`, `mandoc`, `nano`, `less`, and `frotz` are the pinned core tools. --- ## 2. Flashing instructions ### Method A: automated USB EDL flasher (recommended) Run the automated EDL flasher from the repository root on your host machine: ```bash sudo ./flash-edl.sh nokia-argon # Nokia 8110 4G sudo ./flash-edl.sh nokia-beatles # Nokia 2720 Flip ``` *(To flash another target device image, pass its codename, e.g. `sudo ./flash-edl.sh nokia-sparkler`. Pass `--usb-timeout SECS` to adjust per-transfer USB bulk timeout from the 30 s default if needed.)* The programmer is selected automatically: `8110.mbn` (8110 4G), `2720.mbn` (2720 Flip), `800t.mbn` (800 Tough), and `8k.mbn` for **both** 8000 4G and 6300 4G. The 2720 Flip US variant (`Nokia_bts_us`) uses `2720v.mbn`: pass `--variant us` (or `--loader ./bootloader/loaders/2720v.mbn`). Verify with `./flash-edl.sh --list-loaders`. The script performs the following steps automatically: 1. Temporarily pauses host `ModemManager` so it does not interfere with `05c6:9008`. 2. Waits for the phone in Qualcomm EDL/Sahara mode. The flasher auto-detects `05c6:9008` (QDLoader), `05c6:900e` (QHSUSB_BULK, common after a failed boot) and `05c6:9006` (DLOAD); pass `--pid` to force one: - **From Bananarchy Linux**: open the **Power** menu (`End / Power` key or `System menu -> Power`), select **Reboot to loader** (`sxmo_power.sh bootloader`) to enter the visible `lk2nd` Fastboot menu, then select **EDL** (or let `flash-edl.sh` automatically send `fastboot oem reboot-edl`). The low-bit reboot cookie now survives the stock boot chain and keeps the menu available. - **Button combo**: power off the phone, hold **D-Pad up + D-Pad down** (or **`*` + `#`** on `nokia-sparkler` and `nokia-leo`), and plug in the USB cable. - **EDL cable**: hold the EDL cable button while plugging in USB. - **From ADB or Fastboot**: the script automatically sends `adb reboot edl` or `fastboot oem reboot-edl` if detected. - If the phone is stuck in Sahara with no fresh HELLO packet (e.g. a host tool already consumed it), power-cycle it: hold **End/Power** for 15-20 s (or disconnect/reconnect the battery), then retry. The flasher cannot resume a half-open Sahara handshake. 3. Uploads the device-specific Firehose programmer from `bootloader/loaders/` via Sahara and connects to eMMC via Firehose. 4. Backs up `gpt.bin`, `fsc`, `fsg`, `modemst1`, `modemst2`, `persist`, and `boot` into `./backup/` if not already backed up. 5. Flashes `images/bananarchy-.img` to `userdata`, clears the stock `system` superblock (first 64 sectors / 32 KiB), and reboots. This wipe is the default for every method; pass `--no-wipe-system` only if you deliberately want a dual-boot phone with KaiOS intact. **The default `--method lk2nd` writes the source-built `images/boot-lk2nd-nokia-beatles-display.img` into `boot`, and the standalone `images/boot-bananarchy-nokia-beatles.img` into `recovery` on the 2720 Flip (Argon-shaped hybrid).** That lk2nd image is built from upstream lk2nd plus `bootloader/lk2nd/nokia-beatles.patch`: it carries cmdline `lk2nd lk2nd.compatible=nokia,beatles`, keeps the upstream QCDT layout (both `0x14b` entries sharing one DTB), injects a compact `/lk2nd/nokia-beatles` node with the downstream GC9305 v2 panel init stream, and adds `/cpus` with `cpu@0`..`cpu@3` to every QCDT DTB. The 2720's MSM8905 is a partial-goods 2-core part; aboot `ASSERT FAILED at (platform/msm_shared/partial_goods.c:80)` and rebooted into Sahara memory-debug EDL because upstream lk2nd DTBs had no `/cpus` — that was the black-screen/no-fastboot crash. aboot hands off to lk2nd, which keeps aboot's 240x320 RGB565 panel init (or replays the downstream stream when cont-splash is off), then scans `userdata` for `extlinux.conf` and boots `vmlinuz` + `initramfs` with the explicit `fdt /qcom-msm8905-nokia-beatles.dtb`. Rebuild it with `scripts/build-lk2nd-beatles.sh`; see `bootloader/lk2nd/README.md`. The port paints the Bananarchy RGB565 boot splash instead of the near-black upstream splash; the branded screen confirms lk2nd owns the framebuffer. Live `oem display-init` proved the GC9305 v2 stream and frame flush, chain-loaded diagnostics now fall back to the QCDT panel stream, and `oem scan-dtb` captures the final post-update kernel DTB. The release image is display-enabled (`lk2nd.display=on`) so the branded splash and Fastboot menu are visible; the normal no-display image remains available for diagnostics. All QUP/clock polls are bounded, so a dead SPI bus reports a failure instead of hanging. If the phone never shows anything, run `lsusb`: `05c6:900e` means aboot crashed into EDL (Sahara MEMORY_DEBUG), not that lk2nd failed to display; the `/cpus` fix above addresses the confirmed ASSERT. Flash `images/boot-lk2nd-nokia-beatles-diagnostic.img` with `--lk2nd-image --verify --dump-diagnostics` (forced fastboot + runtime `oem display-init` probe), then `fastboot oem log && fastboot get_staged lk2nd.log`; if it returns to `900e`, re-read aboot's RLOG crash buffer (the untouched `bootloader/lk2nd-msm8909.img` lacks `/cpus` as well and crashes identically). See `bootloader/lk2nd/README.md`. If the KaiOS splash persists on a normal power-on, **hold Volume Up** to boot the mainline boot.img in `recovery`. `--method both` is the fallback that writes the standalone `images/boot-bananarchy-nokia-beatles.img` (appended beatles DTB, exact qcom IDs and 512 MiB `/memory` fallback) into both slots; `--method recovery` writes it only to `recovery`. Use `--boot-image PATH` to override the standalone image. Add `--verify` to read back every flashed `boot`/`recovery` partition and confirm the write really committed; a mismatch aborts before `userdata` is touched. Add `--dump-diagnostics` to save small `devinfo`/`aboot`/`tz`/`config` partitions into `backup/diag-*.img` for offline secure-boot analysis. The captured `diag-devinfo.img` proved this 2720 is locked (`is_unlocked=0`, `is_tampered=0`) while `diag-aboot.img` contains `Nokia_beatles ROOT CA0` and `Device is unlocked! Skipping verification...`; aboot therefore rejects every unsigned boot.img. The flasher defaults to unlocking `devinfo` on `nokia-beatles` before writing lk2nd, saves the original as `backup/devinfo-locked-.img`, and accepts `--unlock-bootloader` / `--no-unlock-bootloader`. `scripts/make-unlocked-devinfo.py` can produce the patched image offline. Correction: `target_get_vb_version()` returns `VB_L` on this GPT (no `keymaster`), so aboot reads eMMC `devinfo`, not RPMB. The captured `diag-devinfo.img` after flashing shows `is_unlocked=1`; the eMMC unlock works and **no `fastboot oem unlock-go` step is needed**. `--only-unlock`, `enable_oem_unlock()` and `scripts/make-oem-unlock-config.py` are optional EDL-only prerequisites kept for completeness. EDL is the only required interface. After any DTB change run `python3 scripts/repack-beatles-bootimg.py` and `python3 scripts/sync-beatles-bootfs.py --debug-cmdline`; after any lk2nd change run `./scripts/build-lk2nd-beatles.sh`; never write an Android boot.img directly at raw offset 1 MiB. To diagnose a persistent `05c6:900e` without stock fastboot, power-cycle into EDL and run `python3 scripts/dump-edl-crash.py --out backup/crash-run`; it reads the Sahara memory-debug table and dumps aboot/TZ crash regions. The partition being overwritten is always backed up as `-.img` (e.g. `boot-nokia-beatles.img`), so stale backups from another device are never reused. --- ### Method B: Fastboot flashing (once `lk2nd` is installed) 1. Enter the `lk2nd` Fastboot menu either by selecting **Reboot to loader** from the **Power** menu (`sxmo_power.sh bootloader`) or by holding **D-Pad down** (or **`#`** on `nokia-sparkler` and `nokia-leo`) while powering on the phone. 2. Flash the system image for your device (`nokia-argon` or `nokia-beatles`) to `userdata`: ```bash fastboot flash userdata ./images/bananarchy-.img fastboot erase system fastboot reboot ``` --- ### Method C: booting from a microSD card `lk2nd` automatically checks the microSD card for a `pmOS_boot` partition before internal eMMC: ```bash sudo dd if=./images/bananarchy-.img of=/dev/sdX bs=4M status=progress conv=fsync ``` --- ## 3. Keypad controls and native applications ### 3.1 Global keypad controls (`240x320`) | Physical key | Linux keysym / event | Action | | :--- | :--- | :--- | | **Left softkey (`Menu`)** | `XF86KbdLcdMenu1` (`KEY_MENU`) | Open **System menu**, close open menu, or wake screen (if locked, opens **Passcode Locker** `xlocker`) | | **Right softkey (`Names` / `Back`)** | `XF86KbdLcdMenu2` / `BackSpace` (`KEY_BACK`) | On empty desktop: open **Contacts (`Names`)**; inside apps: open **App context menu** (or close menu if open); in T9 preedit: `BackSpace` | | **Both softkeys together** | `KEY_MENU` + `KEY_BACK` | Toggle **XDrawer** (`xdrawer`) global phone controls overlay from anywhere (disabled while passcode-locked) | | **`*` + `#` together** | `KEY_NUMERIC_STAR` + `KEY_NUMERIC_POUND` | Capture a `240x320` screenshot (`scrot` via `bananarchy-screenshot`) to `~/Pictures/screenshot-YYYYMMDD-HHMMSS.png` | | **Digits `0`–`9`, `*`, `#` (on idle desktop)** | `0`–`9`, `asterisk`, `numbersign` | Open **Dialer** (`xdialer`) and immediately insert the pressed digit, `*`, or `#` | | **Call (green)** | `XF86PickupPhone` / `XF86Phone` (`KEY_SEND`) | Answer incoming call when ringing; on empty desktop: open **Call Log** (`xcalllog`); in menus: confirm (`Return`); in apps: **2x** focus next window, **3x** cycle tiling layout | | **End / Power (red)** | `XF86PowerOff` | Wake or blank screen while passcode-locked, close open plugin/menu, or: **1x** open **Power menu**, **2x** lock phone with passcode (`xlocker`), **3x** (or hold `400ms`) launch a new terminal | | **D-Pad up / down** | `Up` / `Down` | Navigate menus and apps; in `st`: `Shift+Up`/`Shift+Down` (or `ScrlUp`/`ScrlDn` in `Ctl` mode) scrolls terminal history; in T9 preedit: toggle letter case (`a` <-> `A`) or jump `+4` / `-4` candidates | | **D-Pad left / right** | `Left` / `Right` | On empty desktop: switch workspace tags (`-1` / `+1`); in T9 preedit: step back 1 candidate (`Left`) or commit candidate (`Right`); in idle `Ctl` mode: `Home` / `End` | | **Center OK** | `Return` (`KEY_OK`) | Confirm / Enter, or commit active T9 preedit candidate immediately | | **Slider / flip close & open** | `SW_LID` (`lid:on` / `lid:off`) | **Close**: close open menu, turn off main/keypad backlights, and lock phone with passcode (`xlocker`); **Open**: restore screen and keypad backlight and show passcode lock screen | | **2720 Flip outer side keys (closed)** | `KEY_VOLUMEUP` / `KEY_VOLUMEDOWN` / `KEY_POWER` | While the flip is closed, wake the external `240x240` cover display (centered clock, date, battery, and network indicators) for `8 s` (`wake_blank_timeout = 8`, capped below **Config -> Screen blank**) while keeping the internal panel dark | > **Screen blanking, idle blanking, RPM idle standby, passcode locking (`xlocker`), waking, and brightness persistence**: > While unlocked (and with the lid open), the display blanks automatically after the configured **Screen blank** timeout — **5 minutes by default** — via `dwm`'s own evdev input timer and `bananarchy-idle-blank.sh`. Change it in **Config -> Screen blank** (`Off`, 30 s, 1/5/10/30 min), which writes `~/.config/sxmo/idle_blank_timeout`; `bananarchy-idle-timeout.sh get|label|set ` does the same from the shell, and `SXMO_UNLOCK_IDLE_TIME` or `~/.cache/sxmo/sxmo.noidle` still override/disable it. Closing the slider/lid or locking from the **Power** menu blanks the panel **immediately** (both `Lock` and `Lock (Screen off)` now use `xlocker screenoff`), and an incoming call or SMS/notification turns it back on **immediately** via `bananarchy-screen-wake.sh`, which also resets `dwm`'s idle timer so it cannot blank again right away. Any keypad, lid or power key also restores the display; if it arrives before the idle-lock delay elapses, the desktop stays unlocked. Blanking now arms the screenlock daemon: `bananarchy-idle-blank.sh` calls `bananarchy-idle-lock.sh arm`, which starts the trusted `sxmo_state.sh set screenoff` transition (`xlocker screenoff` -> `LOCK_BLANK` on `locker.so`) after **30 seconds** of dark panel by default. Set `~/.config/sxmo/idle_lock_delay` with `bananarchy-idle-lock.sh set 0` to lock immediately on blank, any other number of seconds to change the grace period, or `set off` to keep the old blank-without-passcode behaviour. `bananarchy-idle-lock.sh get|label|cancel` reports and cancels the pending lock; `bananarchy-screen-wake.sh`, `bananarchy-idle-blank.sh on` and `sxmo_hook_unlock.sh` cancel it on every wake, and the transition only fires while the panel is still dark. X11 screensaver timeouts stay at `0 0 0`; DPMS is driven by the backlight state. Traditional Linux **`mem` suspend (`/sys/power/state`)** stays disabled (`# CONFIG_SUSPEND is not set` + `/etc/bananarchy-no-deep-standby`) to keep the pmaports module ABI and instant hardware wakeups (stock firmware lacks PSCI `SYSTEM_SUSPEND`); instead, per-core `cpuidle_qcom_spm` Standalone Power Collapse (`L2_ON`) stays active with `< 0.2 ms` wakeup on all GIC SPIs while `serial@78af000` (`console=ttyMSM0`) is disabled so UART clocks never pin XO or `gpll0`. Locking the phone (`Power -> Lock`, `Power -> Lock (Screen off)`, `2x End / Power`, or closing the physical slider) activates the fullscreen `240x320` **Passcode Locker (`xlocker` / `locker.so`)**, which verifies your numeric system password (`147147` by default, checked against `/etc/shadow` via `/usr/bin/bananarchy-verify-passcode`). While locked, there is no keypad, softkey, slider, or power-button bypass (`dmenu`, `xdrawer`, terminal spawning, and desktop shortcuts are blocked, and only incoming calls can temporarily overlay `xcallscreen`). Screen and keypad brightness levels configured in **XDrawer** or **Config -> Brightness** are persisted in `~/.config/sxmo/brightness` and `/tmp/sxmo_saved_brightness` and restored on every wake. > **Runtime power policy (`/etc/bananarchy-power-policy.conf`)**: > `WIFI_LISTEN_INTERVAL` (1-10, default 8) sets the `wcn36xx` beacon listen interval (`max_listen_interval` and `conf.listen_interval`) via `/etc/modprobe.d/10-bananarchy-power.conf`, while `bananarchy-display-power-sync` toggles `/sys/module/wcn36xx/parameters/screen_off_offload` (enabling WCN3620 ARP/IPv6-NS/GTK, BET, and DTIM offloads via `HOST_SUSPEND_IND` and suppressing healthy-RSSI background multi-channel roam scans while dark) alongside `/sys/module/pm8916_bms_vm/parameters/screen_off` (hardware S3 OCV sleep while dark and discharging). `WIFI_SCREEN_OFF_IPV6_MUTE=1` (default) mutes unsolicited IPv6 router advertisements (`accept_ra=0`) on `wlan0` while dark if `wlan0` already holds an IPv4 address and restores the previous value on wake. `WIFI_STANDBY_RAT=gsm` (default; set `keep` to disable) parks QMI NAS mode preference to GSM after 45 s of darkness while `wlan0` is `up` (verifying CS registration with automatic fallback on 2G-sunset networks) and restores the saved RAT preference on wake. `CPU_RPM_SLEEP=0` and `CPU_L2_SLEEP=0` (both default `0`) control opt-in runtime `/sys/module/cpuidle_qcom_spm/parameters/{rpm_sleep,l2_sleep}` cluster RPM (`vMPM`) and L2 SAW2 sleep handoff; keep `0` by default because per-core SPC with L2 retention already wakes in `< 0.2 ms` on every GIC SPI without collapsing APSS GIC and dropping `smd-edge` modem wakeups during closed-flip standby. `MODEM_DRX_MODE` (default `0`) leaves the firmware's native DSDS paging scheduler untouched without contending with `ModemManager` on open `/dev/wwan0at*` ports; values `6-9` remain opt-in to apply Qualcomm `AT$QCDRX` across all `/dev/wwan0at*` channels (`6` enables ~1.28 s DRX, and `7-9` are progressively longer undocumented paging cycles). The standard `AT+CPSMS` / `AT+CEDRXS` PSM/eDRX commands are not supported by this modem firmware. `DSDS_SECONDARY_MODE=eco` (default `active`) deactivates the secondary SIM's GW provisioning session after `DSDS_PARK_DELAY` seconds (default 300) of a dark panel and restores it on wake; **SIM2 is unreachable while parked**. This uses QMI provisioning sessions, not SIM power-off, so a PIN-locked SIM stays locked. Edit the file as root and run `doas /usr/bin/bananarchy-power-policy.sh apply`, or reboot; `doas /usr/bin/bananarchy-power-policy.sh status` reports the effective values across AT ports, `wcn36xx`, `cpuidle_qcom_spm`, `/sys/kernel/debug/qcom_stats`, and `/sys/kernel/debug/qcom_rpm_master_stats`. See `BATTERY-OPTIMIZATION-ANALYSIS.md` §§15, 20-23. #### 3.1.1 Window tiling modes and switching combos By default, `dwm` uses the **vertical bottom-stack (`bstack`, `TTT`)** layout so multiple `st` terminals stack **vertically (one under another)** to preserve full line width on the `240x320` portrait screen. You can switch layouts, focus, and workspaces using the **Window management menu (`Windows`)** (accessible via `Left softkey -> Windows`, or by pressing **Right softkey** inside non-terminal applications, or selecting `Windows` from the `st` terminal context menu), physical keypad multi-presses, or an external keyboard (`Mod4` / `Super`): - **Window management menu (`WM Menu`)**: provides instant C-level window actions (`Move to WS 1`..`4`, `Shift stack`, `Swap stack`, `Toggle Layout`, `Kill window`, and `Go to WS 1`..`4`), plus `Close Terminal` in the `st` context menu. - **Triple-press Call (green) (`3x Call`)**: cycle the active layout (`TTT` -> `[]=` -> `[D]` -> `[M]` -> `TTT`). - **Double-press Call (green) (`2x Call`)**: move focus to the next open window (`Super+j`). - **Triple-press End / Power (red) (`3x End`)**: launch a new `st` terminal in the active workspace. - **External keyboard shortcuts (`Mod4`)**: - `Mod4+space`: cycle layout (`TTT` -> `[]=` -> `[D]` -> `[M]`). - `Mod4+Shift+slash`: vertical stack layout (`bstack`, `TTT`). - `Mod4+slash`: horizontal tile layout (`tile`, `[]=`). - `Mod4+m`: fullscreen monocle layout (`monocle`, `[M]`). - `Mod4+Up` / `Mod4+Down` (or `Mod4+k` / `Mod4+j`): move focus between tiled windows. - `Mod4+Shift+k` / `Mod4+Shift+j`: move the focused window up or down in the stack. - `Mod4+1`..`4`: switch to workspace tag `1`..`4`. - `Mod4+Shift+q`: close the focused window. #### 3.1.2 Preloaded native DWM applications All twenty-five phone applications are compiled as shared-object plugins (`/usr/lib/dwm/plugins/*.so`), preloaded at `dwm` startup, and awakened over `/tmp/dwm_plugin_.fifo` in `< 2 ms`: 1. **System and context menus (`dmenu.so` / `dmenu` / `xdmenu`)**: - **Open / close**: press **Left softkey (`Menu`)** for the **System menu** or **Right softkey (`Back`)** inside an application for its **Context menu**; press the same softkey or `Escape` to close. - **Built-in submenus and instant toggles**: renders `sys`, `applications`, `scripts`, `modem`, `config`, `sdcard`, `power` (including **Lock**, **Lock (Screen off)**, **Reboot**, **Reboot to loader**, and **Poweroff**; use the lk2nd Fastboot menu for **EDL**), `audio` (with linear volume steps and **Output: Speaker**, **Output: Earpiece**, and **Output: Headphones** routing), `notifications`, `wm`, `timezone`, `games`, `st`, and `nano` menus in place in `< 0.5 ms` without spawning external processes. - **Script compatibility**: any script piping items into `/usr/bin/dmenu` or `sxmo_dmenu.sh` communicates with the resident daemon over `/tmp/dwm_plugin_dmenu.sock`. 2. **Global phone controls (`xdrawer.so` / `xdrawer`)**: - **Open / close**: press **both softkeys simultaneously** (`KEY_MENU` + `KEY_BACK`) from anywhere, or select **XDrawer** from the System menu. - **Controls**: use `Up`/`Down` (or `1`–`9`/`0`) to select linear (`1%`–`100%`) **Speaker**, **Earpiece**, **Ring Vol**, **Ringer** (`Ring+Vib` / `Vibrate` / `Silent` / `DND`), **Vibration** (`Light` / `Medium` / `Strong` with instant tactile feedback), **Flashlight**, **Sound**, **Microphone**, **Screen**, or **Keypad**; use `Left`/`Right` or `Return` to adjust or toggle. 3. **Phone dialer (`dialer.so` / `xdialer`)**: - **Open**: press any **`0`–`9`, `*`, or `#` key** on the empty desktop, or open **Dialer** from the System menu or Call Log. - **Dialing and T9 search**: typing digits filters saved contacts and recent numbers by phone number and T9 name in real time. Hold **`0`** (`>= 420 ms`) or press `Right` / **Left softkey (`+Sign`)** to insert `+`. - **USSD codes and `*#06#` Dual-SIM IMEI display**: - Typing **`*#06#`** immediately opens the **Device IMEI (`*#06#`)** dialog showing `IMEI 1`, `IMEI 2`, and `IMEI SV`. - Typing any USSD code (`*...#` or `#...#`, such as `*100#`) switches the center softkey to **`SEND`**. Pressing **Call (green)** or **Center `OK`** runs the USSD session inside an interactive in-dialer modal with scrollable carrier output and multi-step reply support (prompting for **SIM 1** or **SIM 2** first when two SIM cards are active in DSDS). 4. **Call history and anti-spam blocklist (`calllog.so` / `xcalllog`)**: - **Open**: press **Call (green)** on the empty desktop, or select **Call Log** from the System menu or Dialer. - **Controls**: `Left`/`Right` switches between **`All`**, **`Miss`**, **`In`**, **`Out`**, and **`Spam`** tabs; `Up`/`Down` scrolls; **Call (green)** or **Center `OK`** dials the selected entry. - **Anti-spam blocklist (`~/.config/sxmo/block.tsv`)**: press **Left softkey (`Options`)** to **Block Number (Spam)** or **Unblock Number**, open **Blocklist (N)** to manage blocked numbers, **Block a Number...** (supports exact numbers, 9-digit suffix matching, or prefix wildcards ending with `*`), or **Clear Spam Log** (`~/.local/share/sxmo/block/modemlog.tsv`). Incoming calls from blocked numbers are automatically hung up and recorded in the `Spam` tab without triggering missed-call notifications. 5. **Incoming and active call screen (`callscreen.so` / `xcallscreen`)**: - **Automatic activation and Dual-SIM selection**: wakes the screen and opens automatically on incoming and outgoing calls across both SIM slots (displaying a `[SIM 1]` or `[SIM 2]` badge in the header when Dual-SIM Dual Standby is active). When initiating an outgoing call with two SIMs inserted, `xcallscreen` prompts to choose **`[1] SIM 1`** or **`[2] SIM 2`** (`1`/`2` keys or `Up`/`Down` + `Call`/`Enter`). Pressing **Call (green)** during an active call reopens `xcallscreen` from anywhere. - **Incoming call actions**: press **Call (green)**, **Left softkey (`Accept`)**, **`1`**, or **Center `OK`** to answer; press **`*`** or **`0`** to silence the ringer; press **End (red)**, **Right softkey (`Reject`)**, or **`#`** to decline. - **In-call controls and recording**: - **`[1]` / `*` — microphone mute**: toggles hardware QDSP6 and PipeWire microphone mute (`ON` / `MUTED`). - **`[2]` / `#` — call recording**: starts or stops recording call audio (`8 kHz` mono S16_LE WAV via `MultiMedia2` `hw:0,1` with automatic peak normalization) to `~/Recordings/rec_HHMMSS_.wav`, displaying a live `REC MM:SS` timer while recording and a persistent green `SAVED MM:SS` badge once saved. - **`[3]` — audio route**: cycles between **`BLUETOOTH`** (when a Bluetooth headset is connected, routing call audio over QDSP6 `INT_BT_SCO_RX` / `INT_BT_SCO_TX`), **`SPEAKER`**, and **`EARPIECE`** (or **`HEADPHONES`** when wired headphones are plugged in). - **`Left` / `Right` — call volume**: adjusts in-call volume in `5%` steps. - **`[0]` / Left softkey (`DTMF`)**: toggles DTMF tone keypad mode. - **End (red)** or **Right softkey (`Hangup`)**: hangs up the call. 6. **Contacts phonebook (`contacts.so` / `xcontacts`)**: - **Open**: press the **Right softkey (`Names`)** on the empty desktop, or select **Contacts** from the System menu. - **Search and actions**: type `0`–`9` for live T9/number filtering; press **Call (green)** to dial immediately; press **Center `OK`** for the contact details card (**Call Contact**, **Send SMS**, **Read Messages**, **Open in Dialer**, **Copy to SIM**, **Edit Contact**, **Delete Contact**); or press **Left softkey (`Options`)** for phonebook-wide actions. - **Direct Dual-SIM QMI phonebook import and export**: select **Import from SIM** or **Export to SIM** in the **Options** menu (or **Copy to SIM** on an individual contact) to read or write `EF_ADN` SIM phonebook records directly over Qualcomm QMI UIM (`qrtr://0`) on either **SIM 1** or **SIM 2** — even on the inactive SIM slot. - **Built-in contact editor**: create or edit contacts directly on the keypad (`#` cycles input mode, `*` inserts space, hold `0` or press `Right` for `+`, or pick from recent unknown callers). 7. **SMS manager, composer, and spam filter (`sms.so` / `xsms`)**: - **Open**: select **Texts** from the System menu, or choose **Send SMS** / **Read Messages** from Contacts. - **Conversations, inbox, and spam folder**: browse SMS threads and drafts with contact name resolution, unread indicators, and message bubbles (`Recv` and `Sent`). Press `Left`/`Right` in the thread list (or use **Left softkey (`Options`)**) to switch between **`Inbox`** (`~/.local/share/sxmo/modem`) and the **`Spam`** folder (`~/.local/share/sxmo/block`). - **Full-length messages**: open a thread with **Center `OK`** to read the complete text of long, concatenated, or Unicode (`UCS-2`) messages. Message bodies are drawn line by line and clipped to the bubble, so a multipart message is never cut off at its first line. `Up`/`Down` scrolls inside the selected message (a scrollbar on the right edge shows the position) and steps to the previous/next message once the top or bottom is reached; **Right softkey (`Back`)** returns to the thread list. The QMI WMS daemon reassembles 8-bit and 16-bit concatenated SMS across GSM-7 and UCS-2 (including split surrogate pairs) before writing `sms.txt`, and the `[SIM n]` tag in its log header is stripped when parsing. - **Anti-spam blocking**: press **Left softkey (`Options`)** on any thread or conversation to **Block Number (Spam)** (which adds the sender to `~/.config/sxmo/block.tsv` and moves their thread into the `Spam` folder), **Unblock & Restore** (which unblocks the sender and restores their thread to `Inbox`), **Manage Blocklist (N)**, or **Block a Number...**. Incoming texts from blocked numbers are silently routed into `~/.local/share/sxmo/block` without ringing or vibrating. - **Multi-tap composer**: pick a recipient from Contacts/Recents or type a number (hold `0` for `+`), compose messages with multi-tap keypad entry (`#` cycles input mode), monitor live character/segment counts, save drafts automatically, and send via **Call (green)**, **Center `OK`**, or **Left softkey** (prompting to select **SIM 1** or **SIM 2** when two SIM cards are active in DSDS). The counter is encoding-aware: GSM-7 text shows `units/160` (or `units/306x2` for two concatenated parts at 153 septets each), while any character outside the GSM 7-bit alphabet (for example Ukrainian `є`, `і`, `ї`, `ґ`, or a supplementary-plane character) switches the whole message to UCS-2 and shows `units/70` (or `units/134x2` at 67 UTF-16 units per part). Long composed text is drawn line by line and scrolled so the end of the draft stays visible. 8. **File manager (`files.so` / `xfiles`)**: - **Open**: select **Files** from the System menu or press `Mod4+d`. - **Controls and viewers**: navigate directories with `Up`/`Down`/`Left`/`Right`/`Return`, filter with `0`–`9`, toggle dotfiles with `*`, and cycle sort order (**Name** / **Date** / **Size**) with `#`. - **Integrated GUI text editor (`Edit in Text Editor`)**: available as an action in the **Left softkey (`Actions`)** menu for **any non-directory file** (as well as via **Left softkey (`Edit`)** from the built-in text viewer, or automatically after **New File**): - **Navigation**: `Up`/`Down`/`Left`/`Right` moves the cursor across lines and UTF-8 characters with automatic vertical and horizontal viewport scrolling and line numbers (`Ln:Col`). - **Multi-tap keypad text entry**: type with `0`–`9` and `*` (with a live bottom candidate bar), press `#` to cycle input modes (`[abc]` -> `[Abc]` -> `[ABC]` -> `[123]` -> `[Sym]`), press **Center `OK` (`Return`)** to split the line / insert a newline, and press **Right softkey (`Del`)** or `BackSpace` to delete the character before the cursor (or join with the previous line at column `0`). - **Editor menu (`Left softkey`)**: opens the editor menu with **Save File** (press **Left softkey** twice to save immediately), **Save & Close**, **Insert New Line**, **Insert Space**, **Duplicate Line**, **Delete Line**, and **Close Without Saving**. - **Yabasic (`.yab`) script execution**: pressing `Return` on any `.yab` file (or selecting **Run in Yabasic (Terminal)** from the **Left softkey (`Actions`)** menu) launches `yabasic` inside `st` in the file's directory and waits for `Enter` after completion so output can be inspected. - **J2ME (`.jar` / `.jad`) MIDlet launching**: pressing `Return` on any `.jar` or `.jad` file (or selecting **Run in ReMEdy (J2ME)** from the **Left softkey (`Actions`)** menu) opens it directly in the **ReMEdy (`remedy`)** full-screen `240x320` J2ME emulator; `.jad` files also include a **View JAD Descriptor** action in the **Actions** menu. - **Game Boy / Game Boy Color ROM launching**: pressing `Return` on any `.gb` or `.gbc` file (or selecting **Play in Game Boy Emulator** from the **Left softkey (`Actions`)** menu) opens it directly in the **Gambatte (`gambatte`)** emulator. - **Image preview and wallpaper installation**: pressing `Return` on any image file (`.jpg`, `.png`, `.bmp`, `.gif`, `.webp`, `.ppm`, `.tif`, `.ico`, `.svg`) opens the built-in image viewer (`*` toggles full-screen preview; **Left softkey (`Set Wall`)** installs the image into `~/Pictures/Wallpapers/`, applies it via `feh`, and refreshes the desktop overlay). You can also select **Preview Image** or **Set as Wallpaper** directly from the **Left softkey (`Actions`)** menu. - **Monophonic ringtone viewer (`.nrt`, `.rtttl`, `.rtx`, `.emy`, `.imy`), audio playback, and ringtone/notification installation**: pressing `Return` on any Nokia RTTTL (`.nrt`, `.rtttl`, `.rtx`), Ericsson eMelody (`.emy`), or IrDA iMelody (`.imy`) file opens the built-in **Ringtone Viewer** (`RingtoneView`), displaying the melody title, format tag, BPM, note count, duration, graphical piano-roll pitch contour, and scrollable note sequence (`Up`/`Down`), with instant playback preview (`*` or `Center OK`), `Left`/`Right` to step through ringtones in the current folder, **Left softkey (`Set Ring`)** to set as the active call ringtone, **`#`** to set as the active notification/SMS sound, and `1` to edit the melody text. Pressing `Return` on standard audio or tracker module files opens **Music (`xmusic`)**. From the **Left softkey (`Actions`)** menu on any monophonic melody, audio, or tracker file, select **Preview Ringtone**, **Set as Ringtone**, **Set as Notif / SMS Sound**, **Open in Ringtones App**, or **Play in Music Player**. - **MicroSD card (`/media/sdcard`) integration**: the external microSD slot (`sdhci@7864000`) uses `non-removable` boot-time detection with zero card-detect polling (when empty or idle, `7864900.sdhci` enters `runtime_status = suspended` and drops `l11`/`l12` to `0 mA`). If a microSD card (`/dev/mmcblk1`) is present at boot, `udev` and `/usr/bin/sxmo_sdcard.sh` automatically mount it at `/media/sdcard`; if a card is inserted or swapped while powered on (such as on side-tray phones), run `sxmo_sdcard.sh rescan` or pick **Rescan SD Card Slot** from **System menu -> SD Card**. From the **Left softkey (`Actions`)** menu inside `xfiles` (or **System menu -> SD Card**), select **Open SD Card (/media/sdcard)** to jump straight to the card (mounting it on demand if needed) or **Mount / Unmount SD Card** (`sxmo_sdcard.sh unmount`) to safely flush buffers and unbind `7864900.sdhci` before card removal. - **Bluetooth file transfer (`Send via Bluetooth`) and IMS `.mbn` profiles**: select **Send via Bluetooth** from the **Left softkey (`Actions`)** menu on any file to choose a paired or nearby Bluetooth device (`*` rescans) and transmit the file over Bluetooth OBEX Object Push (`/usr/bin/bananarchy-bt-obex`). On Qualcomm MCFG `.mbn` files, **Install IMS Profile** and **Inspect MBN Profile** parse ELF32 `MCFG_SW` metadata and install/activate the profile via `/usr/bin/bananarchy-imsctl` (blocked in Duress Mode). - **File management actions**: the **Left softkey (`Actions`)** menu also provides **Edit in Text Editor**, **View Text**, **Edit in nano**, **New Folder**, **New File**, **Rename**, **Copy**, **Cut / Move**, **Paste Here**, **Properties**, **Open Terminal Here**, and **Delete**. 9. **Camera (`camera.so` / `xcamera`)**: - **Open**: select **Camera** from the System menu or run `xcamera`. - **Viewfinder and gallery**: streams live `800x600` frames from `/dev/video0` (`GC2395` / `GC2385` / `GC2365`) into a `240x180` 4:3 viewfinder. Press **Center `OK`**, **`5`**, or **Call (green)** to capture a JPEG to `~/Pictures/photo-YYYYMMDD-HHMMSS.jpg`; `*` or `1` toggles **Auto-Flash**; `0` or `2` toggles continuous **Torch**; `Up`/`Down` adjusts **Digital Zoom** (`1.0x` / `2.0x` / `4.0x`); `#` or `3` toggles the **3-second Self-Timer**; **Left softkey (`Gallery`)** opens the built-in photo gallery. 10. **Theme manager (`themes.so` / `xthemes`)**: - **Open**: select **Themes** from the System, Apps, or Config menu, or run `xthemes`. - **Live theme switching and customizer**: browse 21 preinstalled `.xth` schemes (`~/.xthemes/*.xth`) with live color swatches and press **Center `OK`** or **Call (green)** to apply across `dwm`, `dmenu`, `st`, `dunst` (`bananarchy-sync-dunst-theme`), and all plugins with zero restart. Press **`*`** or **Left softkey** to customize individual colors and font sizes, save a custom theme (`#`), or edit the `.xth` file in Nano. 11. **Modem, Dual-SIM, IMS / VoLTE / VoWiFi, and PIN/PUK manager (`modem.so` / `xmodem`)**: - **Open**: select **Modem** from the System menu, or run `xmodem`. Also opens automatically when a SIM card requires PIN or PUK unlock. - **Five control tabs (`Left`/`Right` or `1`–`5`)**: - **`1:SIMs`**: inspects both physical SIM slots via QMI UIM (`PRESENT`/`EMPTY`, `[PRI 4G / DEFAULT]`, `[PRI 4G / DSDS]`, `[SEC 2G / DEFAULT]`, `[SEC 2G / DSDS]`, `READY`/`PIN-LOCK`/`PUK-LOCK`, remaining retries, operator, RAT, and phone number). Press `Return` on a slot (or use the bottom quick-action rows) to **Set as Default SIM (Calls/SMS)** (instant switch without dropping network registration), **Make Primary GW (4G/Data Swap)** (`msm-modem-uim-selection switch --swap-gw` to move 4G/LTE/3G + Mobile Data to that slot and 2G DSDS standby to the other), **Unlock SIM PIN**, **Unblock SIM with PUK**, **Enable / Disable PIN Lock**, or **Change SIM PIN** (with automatic `ModemManager` reprobe after unlock). - **`2:Radio`**: shows signal bar, registration status, access technology (`LTE`/`UMTS`/`GSM`), operator, both IMEIs, and phone number, with actions to switch **Network Mode** (`4G/3G/2G`, `3G/2G`, `4G Only`, `3G Only`, `2G Only`), **Send USSD Code**, toggle **Modem Power**, or **Restart ModemManager**. - **`3:IMS`**: displays live VoLTE and VoWiFi registration status, active carrier MBN profile, `QMI_PDC` / `QMI_IMSDCM` bearer state, and ISIM/USIM `EAP-AKA` readiness. Configure **VoLTE Mode** (`auto` / `on` / `off`), **VoWiFi Mode** (`auto` / `on` / `off`), **VoLTE Backend** (`auto` / `baseband` / `userspace`), **WFC Preference** (`Cellular Pref.` / `Wi-Fi Pref.`), **VoWiFi Roaming**, **Active IMS SIM Slot**, **Manage `.mbn` Profiles** (install, activate, auto-match MCC/MNC, remove, or reset to modem default), and **ePDG & SIP Settings** (`/etc/bananarchy/ims.conf`). Both VoLTE and VoWiFi default to `auto` (disabled unless connected to a strictly **4G-only** network). - **`4:AT`**: interactive AT command console with presets (`AT`, `ATI`, `AT+CPIN?`, `AT+CSQ`, `AT+COPS?`, etc.) and custom keypad entry. - **`5:Log`**: scrollable history of calls, SMS events, and USSD responses. 12. **Networks and Bluetooth manager (`networks.so` / `xnetworks` / `xbluetooth`)**: - **Open**: select **Networks** or **Bluetooth** from the System menu, or run `xnetworks` / `xbluetooth`. - **Three connectivity tabs (`Left`/`Right` or `1`–`3`)**: - **`1:Wi-Fi`**: toggle Wi-Fi radio, rescan (`*`), toggle **Wi-Fi Hotspot**, and connect to WPA2/open networks with a multi-tap password dialog (`*` toggles password visibility). - **`2:Cell/APN`**: toggle **Mobile Data** (running `msm-modem-uim-selection mobile-data-prep` to open QMI `bam-dmux` `wwan0`, synchronize WDS `Profile [1]`/`attach_pdn`/`def_prof`, bind `QMI_WDS` via `libmm-wds-bind.so`, and temporarily pause/restore Dual-SIM `Secondary GW` if required by carrier EFS, then configuring `wwan0` IPv4, default route, and DNS via NetworkManager `rc-manager=file` + local `dnsmasq` caching with automatic `1.1.1.1`/`9.9.9.9` fallback when a carrier omits DNS), inspect `wwan0` IPv4 status, edit **APN Configuration**, and toggle **USB Tethering** (forwarding tethered `172.16.42.1:53` queries to local `dnsmasq`). - **`3:Bluetooth`**: toggle **Bluetooth Power** (showing a live `ON (N Active)` badge and starting `/usr/bin/bananarchy-bt-obex`), toggle **Discoverable** (`OFF (Hidden)` by default to avoid continuous Inquiry Scan standby draw, or `ON (Visible for 60s)`, persisted in `~/.config/sxmo/bt_discoverable`), edit the **Bluetooth Device Name** (`Name: [Edit]`, persisted in `~/.config/sxmo/bt_name` and applied via `bluetoothctl system-alias` independently of the system hostname), configure the **OBEX File Receiver** (`OBEX Dir: [Set]`, opening actions to **Set Target Directory...** via an interactive folder picker including `/media/sdcard`, **Open Folder in Files**, or **Reset to ~/Downloads**, persisted in `~/.config/sxmo/bt_obex_dir`; `#` quick-opens the folder in `xfiles`), scan nearby devices (`*` or `Scan`, 15-second discovery scan), and manage paired/discovered devices. Pairing runs via a persistent `KeyboardDisplay` `Agent1` in `/usr/bin/bananarchy-bt-obex` (with `ssp on`, `bondable on`, `linksec on`, `advertising off`, Smartphone class `2 3`, and `PairableTimeout = 0`), popping up an interactive pairing dialog in `xnetworks` for 6-digit passkey confirmation (`Accept & Pair` / `Reject Pairing`), keypad PIN/passkey entry, or outgoing keyboard pairing codes (while auto-confirming screenless Classic Audio headsets). Incoming OBEX file pushes (over both L2CAP `SOCK_SEQPACKET` and RFCOMM, with Smartphone Class of Device `0x5a020c` and no `a2dp_source` role so paired Android phones recognize OPP rather than a headset) pop up an interactive confirmation dialog showing sender, filename, size, **Accept & Save File**, **Dir: ... [Set]** to pick a different destination folder on the spot, and **Reject Transfer**. The scan now drives one interactive `bluetoothctl` client through `script(1)` (`/usr/local/bin/bluetoothctl` -> `/usr/bin/bananarchy-bt-scan.sh`), sets auto transport and duplicate-data, asks the same client for `devices` three times while discovery is active, parses both `[NEW] Device ...` / `[CHG] Device ...` and `Device ` lines, and stops discovery cleanly before the client exits; the controller is also powered on automatically if `bluetoothctl show` reports `Powered: no`. A narrow `doas` helper runs `btmgmt -i hci0 le on` alongside BR/EDR SSP/bondable flags before discovery because this WCNSS controller otherwise starts with LE and pairing flags unconfigured. BlueZ keeps `ControllerMode = dual`: `bredr` mode rejects the LE-only HOGP profile, so BLE HID devices would connect at the GATT level but never create a keyboard or mouse input node. **Connect Device** and **Pair & Trust Device** run non-blockingly (`--async-ui`), power the adapter on, enable LE/SSP, select the `le` bearer for HID-over-GATT devices, prefer public BR/EDR entries and the `bredr` bearer (`ConnectProfile` A2DP/HFP fallback) for Classic Audio / dual-mode Bluetooth 5.x/6.x headsets or `OBEX/PAN` phones, and automatically pair unpaired peripherals. Active connections are pinned to the top of the device list with a green border and live profile/battery badges (`[ACTIVE: A2DP]`, `[ACTIVE: HSP/HFP]`, `[ACTIVE: HID Gamepad]`, `[ACTIVE: HID Keyboard]`, `[ACTIVE: HID Mouse]`), and the device actions menu (`Center OK`) provides **Connect Device**, **Disconnect Device**, **Pair & Trust Device**, **Switch Audio (A2DP / HSP-HFP)**, and **Forget / Remove Device**. Supports Bluetooth **A2DP** (`sbc`, `sbc_xq`, `aac`, `ldac` ABR `auto`, `aptx`, `aptx_hd`) with AVRCP hardware volume and Play/Pause/Next/Prev headset button control of `xmusic`, and **HSP/HFP** (`CVSD` 8 kHz over QDSP6 `INTERNAL_BT_SCO`, with `mSBC`/`LC3-A127`/`LC3` and unsupported LE Audio BAP roles disabled, plus headset `ATA` call answer/A2DP restore synchronization), **HID keyboards** (automatically switching `fcitx5-t9` and NeoUI/plugin inputs to `[KBD]` direct QWERTY mode so `0-9`, `*`, `#`, `Shift+0-9`, and letters bypass T9 multi-tap and preedit popups), **HID mice** (automatically showing the X11 mouse cursor whenever a mouse is connected and hiding it when disconnected), and **HID gamepads** (automatically bridged to the phone's D-Pad, softkeys, and action keys via `/dev/uinput`). 13. **Ringtones, notification/SMS sounds, and ringer manager (`ringtones.so` / `xringtones`)**: - **Open**: select **Ringtones** from the System, Config, or Audio menu, select **Notification Sound** from the **Notifications (`Notifs`)** menu, or run `xringtones [--notif] [file]`. - **Supported formats**: standard audio (`.wav`, `.ogg`, `.mp3`, `.flac`, `.opus`, `.m4a`, `.aac`), chiptune tracker modules (`.mod`, `.xm`, `.it`, `.s3m`, etc.), and classic monophonic mobile ringtones — **Nokia RTTTL** (`.nrt`, `.rtttl`, `.rtx`), **Ericsson eMelody** (`.emy`), and **IrDA iMelody** (`.imy`) — synthesized via `monotone.h` / `/usr/bin/bananarchy-melody` (`~/Ringtones/`, `~/Music/`, `/usr/share/sxmo/ringtones/`, `/usr/share/sxmo/music/`). - **Three tabs (`1:Ringtone`, `2:Notif/SMS`, `3:Settings` — switch with `1`–`3` or `Left`/`Right` in Tabs 1 and 2)**: - **`1:Ringtone`**: browse and preview call ringtones (`*` or **Left softkey (`Play [*]` / `Stop`)**), press `Return` to set the active **Call Ringtone** (`~/.config/sxmo/ringtone`), or press `#` to quick-assign the highlighted tone as the **Notification / SMS Sound**. - **`2:Notif/SMS`**: browse and single-shot preview notification/SMS alert tones (including `None (Mute Sound)` for vibration-only notifications) and press `Return` to set the active **Notification / SMS Sound** (`~/.config/sxmo/notif_sound` and `SXMO_TEXTSOUND` in `~/.config/sxmo/ringsettings`), wired directly into the system notification manager (`sxmo_notifs.sh`, `sxmo_hook_notification.sh`, `sxmo_hook_sms.sh`, `xirc`, and `xtox`). - **`3:Settings`**: configure **Ringer Mode** (`Ring + Vibrate`, `Ring Only`, `Vibrate Only`, `Silent`), **Notif / SMS Sound** (`Left`/`Right` cycles tones, `*` previews, `Return` opens Tab 2), **Call Ringtone** (`Left`/`Right` cycles tones, `*` previews, `Return` opens Tab 1), **Ring & Alert Volume** (`0%`–`100%`, also adjustable in **XDrawer**), **Call Ring Duration**, **Call Ring Loop Count**, and 3-level hardware **Vibrate Strength** (`Level 1 (Light)` pulsed `1600 mV`, `Level 2 (Medium)` pulsed `2100 mV`, `Level 3 (Strong)` continuous `3100 mV`, `Return` tests vibration). 14. **Desktop wallpaper manager (`wallpapers.so` / `xwallpapers` / `xbackground`)**: - **Open**: select **Wallpapers** from the System, Config, or Apps menu, or run `xwallpapers`. - **Controls**: browse system and user wallpapers with a live portrait thumbnail, cycle scaling mode (`Fill`, `Scale`, `Fit`, `Center`, `Tile`) with `Left`/`Right` or `#`, toggle full-screen preview with `*`, and press `Return` to apply the wallpaper and immediately refresh the desktop overlay. 15. **Music and tracker module player (`music.so` / `xmusic` / `xplayer`)**: - **Open**: select **Music** from the System, Applications, or Audio menu, open any audio/tracker file from **Files (`xfiles`)**, or run `xmusic [file_or_dir]`. - **Supported formats**: plays standard audio (`.wav`, `.mp3`, `.ogg`, `.flac`, `.opus`, `.m4a`, `.aac`) as well as classic chiptune/tracker modules (`.mod`, `.xm`, `.it`, `.s3m`, `.mptm`, `.stm`, `.med`, `.okt`, `.669`, `.ult`, `.far`, `.mtm`, `.ptm`, `.amf`, `.dsm`, `.imf`, `.gdm`, `.stx`, `.umx`, `.mo3`) via an embedded `mpv` + `FFmpeg` + `libopenmpt` backend that automatically pauses on incoming calls. - **Three tabs (`1:Player`, `2:Queue`, `3:Files` — switch with `1`–`3` or `Left`/`Right` in Queue/Files)**: - **`1:Player`**: displays format badge (`MOD`, `XM`, `MP3`, etc.), scrolling track title, artist/metadata, animated equalizer bars, elapsed/total progress bar, repeat mode (`Off`, `All`, `One`), shuffle state, and volume. Press `Return` or `5` to **Play/Pause**, `Left`/`Right` (`4`/`6`) to **Seek `-5s`/`+5s`**, `Up`/`Down` (`2`/`8`) to adjust **Volume**, `7`/`9` for **Prev/Next track**, `*` to cycle **Repeat**, `#` to toggle **Shuffle**, `0` to **Stop**, or **Left softkey (`Options`)** to install the current track as the phone ringtone. - **`2:Queue`**: browse the active playlist queue, filter with `0`–`9`, press `Return` to jump to a track, `*` to remove a track, `#` to shuffle, or **Left softkey (`Actions`)** to set the selected track as ringtone or clear the queue. - **`3:Files`**: browse the filesystem (`~/Music`, `/usr/share/sxmo/music`, `/usr/share/sxmo/ringtones`, or any folder), press `Return` to play a file and load its folder into the queue, `*` to append a file or folder to the queue, or `#` to play the entire current folder. 16. **SIP VoIP client (`sip.so` / `xsip`)**: - **Open**: select **SIP VoIP** from the System or Applications menu, or run `xsip`. - **Three tabs (`1:Dialer`, `2:Accounts`, `3:History` — switch with `Left`/`Right`)**: - **`1:Dialer`**: enter a SIP URI (`user@host[:port]` or `sip:user@host[:port]`) or account extension (`1001`) using multi-tap alphanumeric input (`*` or `#` cycles `[abc]` / `[ABC]` / `[123]` / `[Sym]` / `[Abc]`) or select a recent peer with `Up`/`Down`, and press **Call (green)** or **Center `OK`** to place an outgoing SIP call. Outbound calls work both with a registered SIP account and directly without any configured account (`Direct URI` mode, selectable via `Menu -> Switch Account` when accounts are also present). - **`2:Accounts`**: add or edit SIP accounts (`~/.config/sxmo/sip_accounts.tsv`: Label, alphanumeric Username, Password, Domain, Port, UDP/TCP/TLS transport, ZRTP toggle, Preferred Codec, Enabled). Enabled accounts maintain RFC 3261 `REGISTER` keepalives with Digest MD5 authentication in the background even when `xsip` is closed. - **`3:History`**: browse incoming, outgoing, and missed SIP calls (`~/.local/share/sxmo/sip_history.tsv`) and press **Call (green)** or **Center `OK`** to redial. - **Audio codecs (`AUTO`, `PCMU`, `PCMA`, `GSM`, `OPUS`, `G722`, `AMR-WB`, `AMR-NB`, `G726-32`, `DVI4`, `L16`)**: supports full SDP `m=audio` / `a=rtpmap` / `a=fmtp` negotiation across narrowband (`8 kHz`) and wideband (`16 kHz`) RTP/SRTP audio profiles, prioritizing **ITU-T G.711** `PCMU` (`PT 0`) and `PCMA` (`PT 8`, 8 kHz 64 kbps) first in `AUTO` mode, followed by **GSM 06.10 Full Rate** (`GSM/8000`, `PT 3`, 8 kHz 13 kbps RPE-LTP), **Opus** (`opus/48000/2`, RFC 7587, 16 kHz wideband VoIP with in-band FEC), **ITU-T G.722** (`G722/8000`, 16 kHz wideband 64 kbps SB-ADPCM), **AMR-WB** (`AMR-WB/16000`) and **AMR-NB** (`AMR/8000`, RFC 4867 octet-aligned and bandwidth-efficient modes), **ITU-T G.726-32** (`G726-32/8000`, 8 kHz 32 kbps ADPCM), **IMA ADPCM** (`DVI4/8000` `PT 5` and `DVI4/16000` `PT 6`), and **uncompressed 16-bit PCM** (`L16/8000` and `L16/16000`), plus **RFC 2833 / RFC 4733 `telephone-event/8000`** DTMF. Preferred codec priority is configurable per account (`Codec` field in the Account Editor) or for direct accountless calls (`Menu -> Cycle Direct Codec`). - **ZRTP / SRTP encryption and CallScreen (`xcallscreen`) integration**: supports RFC 6189 **ZRTP** (`DH3k` 3072-bit / `DH2k` 2048-bit Diffie-Hellman key agreement with `a=zrtp-hash` SDP signaling and persistent 96-bit `ZID`) and RFC 3711 **SRTP** (`AES-128-CM` + `HMAC-SHA1-80`/`32`) encrypted voice media (`ON` by default per account and for direct accountless calls via `Menu -> Toggle Direct ZRTP`). Incoming `INVITE` requests wake the phone, trigger the ringtone/vibrator, and open `xcallscreen` with a `[SIP/]` badge; once ZRTP completes its handshake, the active codec and 4-character Short Authentication String (`SAS`) are displayed in both `xsip` (` | ZRTP SAS:`) and `xcallscreen` (`[SIP/:]`). 17. **Email client (`email.so` / `xemail` / `xmail`)**: - **Open**: select **Email** from the System or Applications menu, or run `xemail` / `xmail`. - **Three tabs (`1:Inbox`, `2:Compose`, `3:Accounts` — switch with `Left`/`Right`)**: - **`1:Inbox`**: fetches headers and message bodies via `IMAP4rev1` or `POP3` over implicit TLS (`993`/`995`), `STARTTLS` (`143`/`110`), or plain TCP (`~/.local/share/sxmo/email/`), decoding RFC 2047 encoded-word subjects/senders, Base64/Quoted-Printable MIME parts, and HTML-only bodies. Press **Center `OK`** to open the full-screen message reader (`Up`/`Down` scrolls, **Center `OK`** replies), or **Call (green)** to sync the active account. - **`2:Compose`**: enter `To`, `Subject`, and `Body` with multi-tap input (`*` cycles mode) and press **Call (green)** or **Left softkey (`Menu -> Send Email Now`)** to send via `SMTP` (`465` TLS or `587` `STARTTLS` with `AUTH PLAIN` / `AUTH LOGIN`). - **`3:Accounts`**: add or edit multiple email accounts (`~/.config/sxmo/email_accounts.tsv`). 18. **IRCv3 client (`irc.so` / `xirc`)**: - **Open**: select **IRC Chat** from the System or Applications menu, or run `xirc`. - **Three tabs (`1:Chat`, `2:Buffers`, `3:Servers` — switch with `Left`/`Right`)**: - **`1:Chat`**: displays scrollable message history (`Up`/`Down`) and multi-tap input bar (`*`/`#` cycles mode, **Center `OK`** or **Call (green)** sends message or executes `/join`, `/part`, `/leave`, `/close`, `/msg`, `/query`, `/nick`, `/me`, `/clear`, `/connect`, `/disconnect`, `/raw`, `/quit`). - **`2:Buffers`**: lists server `*status*` buffers, joined `#channels`, and private query buffers with server/nick/connection subtitle and unread (`+N`) or `ACTIVE` badges. Highlight any buffer with `Up`/`Down` (or `2`/`8`) to switch the active buffer and press **Center `OK`**, `5`, **Call (green)**, `Left`, or **Right softkey (`Back`)** to open it in `Chat`; press `BackSpace` or **Left softkey (`Menu -> Close Buffer`)** to part and close the selected buffer. - **`3:Servers`**: manage multiple IRC servers (`~/.config/sxmo/irc_servers.tsv`, preconfigured with Abjects (`irc.abjects.net`) over TLS `6697` and auto-joining `#bananarchy`), supporting OpenSSL TLS, IRCv3 capability negotiation (`CAP LS 302`: `sasl`, `server-time`, `message-tags`, `multi-prefix`, `away-notify`, `account-notify`, `chghost`, `cap-notify`), and `SASL PLAIN` authentication. - **Background mode (`BG Mode`)**: when `BG Mode` is enabled on a server, closing `xirc` keeps the active IRC socket connection alive in the resident daemon and triggers notification hooks on nick highlights or private messages. 19. **Tox / Trifa P2P messenger and audio call client (`tox.so` / `xtox`)**: - **Open**: select **Tox (Trifa)** from the System or Applications menu, or run `xtox`. - **Three tabs (`1:Friends`, `2:Chat`, `3:My Tox ID` — switch with `Left`/`Right`)**: - **`1:Friends`**: lists pending friend requests (press **Center `OK`** to accept) and saved friends with live status (`ONLINE (UDP)`, `ONLINE (TCP)`, `OFFLINE`). Press **Center `OK`** to open encrypted chat or **Call (green)** to start a `ToxAV` voice call. - **`2:Chat`**: end-to-end encrypted P2P messaging (`~/.local/share/sxmo/tox/logs/`) with multi-tap input (`*` cycles mode, **Center `OK`** sends, **Call (green)** initiates a voice call). - **`3:My Tox ID`**: displays your 76-character hexadecimal Tox ID (also exported to `/tmp/tox_id.txt` for easy copying over SSH) and DHT connection state (`DHT(UDP)` / `DHT(TCP)`). - **Standby `ToxAV` voice calls**: incoming 48 kHz Opus `ToxAV` calls wake the display and open `xcallscreen` with a `[TOX]` badge. 20. **Quagr encrypted pager (`quagr.so` / `xquagr` / `quagr`)**: - **Open**: select **Quagr Pager** from the System or Applications menu, or run `xquagr` / `quagr` (hidden and blocked in Duress Mode). - **Three tabs (`1:Receive`, `2:Send`, `3:Config` — switch with `Left`/`Right`)**: - **`1:Receive`**: displays relay subscription state (`OFFLINE`, `CONNECT`, `LISTEN`, `RECONN`), topic, Rx key fingerprint, and scrollable received page history (`~/.local/share/sxmo/quagr/rx.log`). Press **Call (green)** (or **Center `OK`** when empty / **Menu -> Listen Now**) to subscribe or stop, and press **Center `OK`** on any received page to open the full wrapped page modal (press **Left softkey (`To Send`)** to copy it into the composer). - **`2:Send`**: multi-tap / `fcitx5-t9` composer enforced at the `30`-byte UTF-8 Quagr wire limit with a live `N / 30 bytes` progress meter and sent history (`~/.local/share/sxmo/quagr/tx.log`). Press **Center `OK`** or **Call (green)** to encrypt with the Tx key and `POST` to the relay. - **`3:Config`**: stores `~/.config/sxmo/quagr.conf` (`0600`). Configure **Autostart Receiver** (`ON`/`OFF`), independent **Rx Key Mode** and **Tx Key Mode** (`Passphrase` using `SHA256("QUAGR:" || passphrase)` vs `Raw Hex (64)` for 32-byte raw keys), **Copy Rx -> Tx**, **Generate Rx Hex Key**, **Relay Base URL** (default `https://ntfy.sh`), **Topic ID** (default `quagr-public`), and **Show Secrets**. - **Opt-in background receiver & notifications**: `quagr_plugin_init` and `dwm-plugin quagr --preload` **only** autostart the background stream receiver when **both** **Autostart Receiver** is `ON` (`autostart_rx=1`) **and** a valid Rx passphrase or 64-character hex key is set. Decrypted incoming pages emit a standard Sxmo notification (`$SXMO_NOTIFDIR/quagr_*` -> desktop toast, sound, and main-screen wake when open) and, on **Nokia 2720 Flip (`nokia-beatles`)** with the flip closed, send `QUAGR ` directly to `bananarchy-cover-idle`, immediately lighting the `240x240` cover display with the full wrapped message until dismissed with any side button (`Volume Up`, `Volume Down`, or `Power`) or by opening the flip. 21. **Kopher SmallWeb browser (`smallweb.so` / `xkopher` / `kopher` / `xsmallweb`)**: - **Open**: select **SmallWeb (Kopher)** from the System or Applications menu, or run `xkopher [url]` / `kopher [url]`. - **Supported protocols**: **Gopher** (`gopher://`, plus optional TLS `gophers://` or the in-menu `Gopher over TLS` toggle), **Gemini** (`gemini://` over TLS with text/gemini rendering and input prompts), **Spartan** (`spartan://`), and **Nex** (`nex://`), plus built-in `about:kopher` and `about:help` pages. - **Default WAP-style keypad controls (from [Kopher](https://code.luxferre.top/luxferre/kopher.git), customizable in `~/.config/sxmo/smallweb_controls.tsv` via `Menu -> Customize Controls`)**: - **`2` / `Up` and `8` / `Down`**: scroll up / down 1 line - **`4` / `Left` and `6` / `Right`**: jump to previous / next link - **`5` / `Center OK`**: open highlighted link or submit input prompt - **`1` and `7`**: scroll left / right (`4` columns when line wrapping is off) - **`3` and `9`**: jump to top / bottom of page - **`*`**: toggle line wrapping (`WRAP` / `NOWRAP`) - **Link focus always scrolls the viewport**: jumping to the previous / next link (or toggling wrap) scrolls the focused link into view using the actual wrapped display rows, in both `WRAP` and `NOWRAP` modes. With wrapping off, horizontal scroll is reset to the start of the link label. Page End also uses display rows rather than logical lines. - **`#`**: toggle light / dark reader theme - **`0`**: reload current page - **`Call (green)`**: open URL address bar (`*` cycles input mode; `Call` inside the address bar toggles `Gopher TLS`) - **`Right softkey` / `BackSpace`**: navigate back in history (or close when at root) 22. **Webarchy Web browser (`webarchy.so` / `webarchy` / `xwebarchy`)**: - **Open**: select **Webarchy (Web)** from the System or Applications menu, or run `webarchy [url]` / `xwebarchy [url]`. - **Engine, User-Agent, encoding, fonts, and multimedia**: built on WPE / WebKit (`webkit2gtk-4.1` + `libwpe-1.0`) with Adreno 304 hardware acceleration (`WEBKIT_HARDWARE_ACCELERATION_POLICY_ALWAYS` and WebGL) and 512 MB RAM pressure tuning (`160 MB` WebProcess cap). Uses `UTF-8` as the primary/default encoding when a server specifies none, configures Google **Noto** (`Noto Sans`, `Noto Serif`, `Noto Sans Symbols`, `Noto Sans Math`, `Noto Color Emoji`) as the default non-monospace web fonts while keeping **Fira Code** with OpenType ligatures (`calt`, `liga`) for monospace (`code`, `pre`, `kbd`, `samp`, `tt`), enables all HTML5/GStreamer multimedia playback (`MediaSource` / MSE, WebAudio, inline `