feat(x11): migrate to pure Xlibre + dwm/dmenu/st stack, fix fcitx5-t9 bottom bar, PM8909 PON shutdown, and remove Wayland

This commit is contained in:
Luxferre
2026-10-20 21:15:16 +03:00
parent ad012360c3
commit 7bab7b7a11
422 changed files with 63226 additions and 2342 deletions
+27 -34
View File
@@ -23,12 +23,16 @@ This manual covers flashing, operating, and customizing **Bananarchy Linux** (`v
- `bootloader/loaders/8110.mbn` — signed Qualcomm Sahara/Firehose programmer (`05c6:9008`).
### 1.3 Integrated hardware & UX tweaks
1. **Native 1:1 `240x320` resolution & enlarged fonts**:
- Sway runs at `output * scale 1` (`SXMO_SWAY_SCALE=1`) with Xwayland disabled to save RAM.
- Enlarged fonts across all UI layers: `Sxmo 13` window titles and `24px` top bar, `34pt`/`14pt` Conky clock/date positioned cleanly above the Bananarchy emblem wallpaper, `15px` bold Wofi full-screen menus (`240x296`), `13pt` Foot terminal font, `220x28` Wob volume/brightness overlay, and `12pt` Dunst notifications.
1. **Native 1:1 `240x320` resolution, cross-compiled Xlibre, `Fira Code` ligatures & ultra-low-latency Sxmo X11 UI**:
- **Cross-compiled Xlibre (`X11Libre/xserver` 25.2.0)**: compiled specifically for ARMv7 Cortex-A7 (`-O2 -march=armv7-a -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard -fno-plt -fomit-frame-pointer`) with all 3D/GLX/Glamor/VGA/DGA/XVideo bloat stripped out, rootless `elogind` device management, and `modesetting` KMS + `ShadowFB` (`drmModeDirtyFB` partial rectangle SPI updates) with automatic software cursor fallback on `/dev/dri/card0` (`panel-mipi-dbi`).
- **Non-Nerd `Fira Code` with OpenType ligatures**: `Fira Code` (`font-fira-code`) is configured as the primary system and terminal font across Fontconfig, Xft, `st`, `dmenu`, `dwm`, `conky`, and `dunst`, with `DejaVu SansM Nerd Font` used strictly as a fallback for Private Use Area icon glyphs.
- **Patched `sxmo-st` (`st`) with HarfBuzz ligatures & XIM**: patched with `libharfbuzz` (`hb.c`/`hb.h`) shaping (`liga`, `calt`, `clig`, `dlig`) so multi-character programming operators (`->`, `=>`, `!=`, `<=`, `>=`, `===`, `::`, `//`, `/*`) render as continuous ligatures at `pixelsize=15`, alongside full `XIM` (`fcitx5-t9`) input support.
- **Patched `sxmo-dmenu` (`dmenu`) (`< 15 ms` startup)**: full-width `240x320` 9-line vertical menu (`lineheight = 26`, positioned flush at `Y = 24` right below the 24px `dwm` bar) with a `#383838` top search bar, `#005577` prompt badge, `#1c1c1c` item list, `XIM` (`XSetLocaleModifiers("")`, `XSetICFocus`, `Xutf8LookupString`) for live `fcitx5-t9` search filtering and `#` mode switching, C-level focus preservation (`prevfocuswin`), and direct Nokia keypad bindings.
- **Patched `sxmo-dwm` (`dwm`) (`< 2 ms` display wake/unlock)**: configured for `240x320` (`bh = 24`, `#323232` top bar, `#005577` active tag/border, vertical `bstack` layout default, overflow-protected Pango status bar rendering keeping the right-aligned clock always visible). Directly polls `/dev/input/by-path/platform-gpio-keys-event` (`SW_LID`) and intercepts locked-state wake keys (`XF86PowerOff`, `XF86PickupPhone`, `XF86KbdLcdMenu1`, `XF86KbdLcdMenu2`) in C to toggle `/sys/class/backlight/backlight/brightness` and `/sys/class/leds/white:kbd_backlight/brightness` in `< 2 ms` before running Sxmo state hooks asynchronously.
2. **Multi-mode `fcitx5-t9` keypad engine (`src/fcitx5-t9/`)**:
- Supports 6 input modes cycled with `#` (`XF86NumericPound`): `abc`, `Abc`, `ABC`, `Sym`, `Ctl`, and `123`.
- Includes instant case toggling during preedit, full 32-character ASCII punctuation/symbol entry, terminal control sequences (`^A`–`^Z`, `Esc`, `Tab`, `F1`–`F12`), and a `450ms` long-press `*` `Ctrl+` modifier latch.
- 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).
4. **Mainline 6.12.1-msm8916 QDSP6 audio (loudspeaker, earpiece, MEMS & headset mics), voice call & LTE modem stack**:
@@ -114,46 +118,35 @@ sudo dd if=./images/bananarchy-nokia-argon.img of=/dev/sdX bs=4M status=progress
> - Pressing **End / Power (red)**, **Left softkey**, **Right softkey**, or **Call (green)** once.
#### 3.1.1 Window tiling modes & switching combos
By default, Sxmo Sway is configured with **`default_orientation vertical` (`splitv`)**, so opening multiple terminals stacks them **vertically (one terminal under another)** to maximize line width on the `240x320` portrait screen.
By default, Sxmo `dwm` is configured with the **vertical bottom-stack (`bstack`, `TTT`)** layout as default, so opening multiple `st` terminals stacks them **vertically (one terminal under another)** to maximize line width on the `240x320` portrait screen.
You can switch between **vertical (`splitv`, one under another)**, **horizontal (`splith`, side-by-side)**, and **tabbed (`tabbed`, full-screen tabs)** layouts — as well as switch focus between open terminals — using any of the following combos:
You can switch between **vertical stack (`TTT`, `bstack`)**, **horizontal tile (`[]=`, `tile`)**, **deck (`[D]`, `deck`)**, and **fullscreen monocle (`[M]`, `monocle`)** layouts — as well as switch focus between open terminals — using any of the following combos:
1. **Direct physical keypad combos**:
- **Triple-press Call (green) (`3× Call`)**: cycles the current container layout (`vertical splitv` -> `horizontal splith` -> `tabbed` -> `vertical splitv`).
- **Double-press Call (green) (`2× Call`)**: switches focus to the next open window/terminal (e.g., jumps between the top and bottom terminals).
- **Triple-press (or hold `400ms`) End / Power (red) (`3× End`)**: opens a new `Foot` terminal tiled in the active layout.
2. **Terminal context menu (`Right softkey` or `1× Call (green)` inside `Foot`)**:
- **Next window**: switch focus to the next open terminal/window.
- **Toggle layout**: cycle `splitv` -> `splith` -> `tabbed`.
- **Tile vertical**: immediately arrange open windows vertically (one under another) and set future splits to vertical.
- **Tile horizontal**: immediately arrange open windows horizontally (side-by-side) and set future splits to horizontal.
- **New terminal** / **Close terminal**: open a new terminal or close the focused terminal.
3. **System windows menu (`Left softkey` -> `Windows`)**:
- **Next window**: focus the next window in the workspace.
- **`splitv -> splith -> tabbed`**: cycle container layout mode.
- **Split vertical** / **Split horizontal** / **Tabbed layout**: switch directly to the chosen layout.
- **Switch menu** / **Move menu** / **Kill window**: switch to any window across workspaces, move windows between positions/workspaces, or close the focused window.
4. **External keyboard / `swaymsg` (`$mod` = `Mod4` / `Super`)**:
- `Mod4+v`: vertical split (`splitv`)
- `Mod4+b`: horizontal split (`splith`)
- `Mod4+e`: toggle split orientation (`layout toggle split` between vertical and horizontal)
- `Mod4+w`: tabbed layout (`layout tabbed`)
- `Mod4+s`: stacking layout (`layout stacking`)
- `Mod4+f`: toggle fullscreen (`fullscreen`)
- `Mod4+Up` / `Mod4+Down` / `Mod4+Left` / `Mod4+Right`: move focus between tiled windows
- `Mod4+Shift+Up` / `Mod4+Shift+Down` / `Mod4+Shift+Left` / `Mod4+Shift+Right`: reposition focused window
- **Triple-press Call (green) (`3× Call`)**: cycles the current DWM layout (`TTT` -> `[]=` -> `[D]` -> `[M]` -> `TTT`).
- **Double-press Call (green) (`2× Call`)**: switches focus to the next open window/terminal (`Super+j`).
- **Triple-press End / Power (red) (`3× End`)**: opens a new `st` terminal (with HarfBuzz `Fira Code` ligature support) tiled in the active layout.
2. **External keyboard / `xdotool` (`MODKEY` = `Mod4` / `Super`)**:
- `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 focused window up/down in the stack
- `Mod4+1`..`4`: switch to workspace tag `1`..`4`
- `Mod4+Shift+q`: close focused window
### 3.2 Multi-mode `fcitx5-t9` keypad reference
- **Short-press `#`** *(when no character is in preedit)*: cycles through the 6 input modes (`abc` -> `Abc` -> `ABC` -> `Sym` -> `Ctl` -> `123` -> `abc`), displaying a `900ms` preedit status banner (`[Mode: abc]`, `[Mode: Abc]`, `[Mode: ABC]`, `[Mode: Sym]`, `[Mode: Ctl]`, `[Mode: 123]`).
- **Auto-commit timeout**: `600ms` for keys with `<= 10` candidates, or `750ms` for keys with `> 10` candidates (`1` and `*` in `abc`/`Abc`/`ABC`, `*` in `Sym`, `9` in `Ctl`). Pressing a different key immediately commits the active candidate.
- **Short-press `#`** *(when no character is in preedit)*: cycles through the 6 input modes (`abc` -> `Abc` -> `ABC` -> `Sym` -> `Ctl` -> `123` -> `abc`), displaying a `1500ms` preedit status banner (`[Mode: abc]`, `[Mode: Abc]`, `[Mode: ABC]`, `[Mode: Sym]`, `[Mode: Ctl]`, `[Mode: 123]`).
- **Auto-commit timeout**: `1500ms` for keys with `<= 10` candidates, or `1800ms` for keys with `> 10` candidates (`1` and `*` in `abc`/`Abc`/`ABC`, `*` in `Sym`, `9` in `Ctl`). Pressing a different key immediately commits the active candidate.
- **While a candidate is highlighted (`[item]`) in preedit**:
- Press **`#`** or **D-Pad `Up`**: toggles letter case (`a` <-> `A`) on the fly without changing mode, or jumps forward **`+4` candidates** for non-alphabetic items.
- Press **D-Pad `Down`**: toggles letter case (`a` <-> `A`) for alphabetic items, or jumps backward **`-4` candidates** for non-alphabetic items.
- Press **D-Pad `Left`**: steps backward **1 candidate** on the same key.
- Press **D-Pad `Right`** or **Center `OK` (`Return`)**: commits the highlighted candidate immediately.
- Press **`BackSpace`**: cancels the uncommitted preedit candidate without deleting previously committed text.
- **Long-press (`>= 450ms`)**:
- **Long-press (`>= 550ms`)**:
- **Hold `0`–`9`**: commits the digit (`0`–`9`) immediately in any mode.
- **Hold `*`**:
- In `123` mode: commits a decimal point (`.`) immediately.
@@ -230,7 +223,7 @@ You can switch between **vertical (`splitv`, one under another)**, **horizontal
ssh user@172.16.42.1
```
- **Bantam AI agent**:
Run `bantam` in the terminal (`Foot`) or over SSH. Configure your endpoint/API key via environment variables or `~/.bantam.cfg` when needed.
Run `bantam` in the terminal (`st`) or over SSH. Configure your endpoint/API key via environment variables or `~/.bantam.cfg` when needed.
---